ci: simplify adding & removing deqp patches
authorEric Engestrom <eric@igalia.com>
Fri, 17 Feb 2023 17:09:28 +0000 (17:09 +0000)
committerMarge Bot <emma+marge@anholt.net>
Fri, 17 Feb 2023 20:17:08 +0000 (20:17 +0000)
Instead of everyone having to copy the curl command from somewhere else
when a new deqp version needs new patches; now all they need to do is
paste the commit hash in the array.

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21392>

.gitlab-ci/container/build-deqp.sh

index 2827aab..27b09f7 100644 (file)
@@ -12,16 +12,22 @@ git clone \
     /VK-GL-CTS
 pushd /VK-GL-CTS
 
-# Apply a patch to update zlib link to an available version.
-# vulkan-cts-1.3.3.0 uses zlib 1.2.12 which was removed from zlib server due to
-# a CVE. See https://zlib.net/
-# FIXME: Remove this patch when uprev to 1.3.4.0+
-curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
-    "https://github.com/KhronosGroup/VK-GL-CTS/commit/6bb2e7d64261bedb503947b1b251b1eeeb49be73.patch" | git am -
-
-# Apply a patch to fix a bug in 1.3.3.0 that affects some new formats
-curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
-    "https://github.com/KhronosGroup/VK-GL-CTS/commit/4fa2b40411921b304f5dad8d106b212ad5b0f172.patch" | git am -
+cts_commits_to_backport=(
+    # Update zlib link to an available version.
+    # vulkan-cts-1.3.3.0 uses zlib 1.2.12 which was removed from zlib server due to
+    # a CVE. See https://zlib.net/
+    # FIXME: Remove this patch when uprev to 1.3.4.0+
+    6bb2e7d64261bedb503947b1b251b1eeeb49be73
+
+    # Fix a bug in 1.3.3.0 that affects some new formats
+    4fa2b40411921b304f5dad8d106b212ad5b0f172
+)
+
+for commit in "${cts_commits_to_backport[@]}"
+do
+  curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
+    "https://github.com/KhronosGroup/VK-GL-CTS/commit/$commit.patch" | git am -
+done
 
 # https://github.com/KhronosGroup/VK-GL-CTS/pull/360
 sed -i -e 's#http://zlib.net/zlib-1.2.12.tar.gz#http://zlib.net/fossils/zlib-1.2.12.tar.gz#g' external/fetch_sources.py