summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJimmy Brisson <jimmy.brisson@arm.com>2023-03-22 13:20:20 -0500
committerManish V Badarkhe <manish.badarkhe@arm.com>2023-03-29 22:45:03 +0200
commitf134e4c77ba6950b9088cc040be40e6eb7446bb0 (patch)
tree8c8b0267e47aa976510c9f3619a9e9a0e0a2110a
parent65828188996e8a4d93220b9836d95ad0f4d058e7 (diff)
Allow repeated patch applys
The patches were not idempotent, as in after the first attempt to build locally using the ci scripts, subsequent builds would fail in the apply patch step. This patch checks for the presence of the patch by attempting to apply the inverse of the patch. If that works, then the patch was already applied. Change-Id: I9ba4267f6a0a567ae13dcaf2c98a7dff204347ce
-rwxr-xr-xscript/build_package.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/script/build_package.sh b/script/build_package.sh
index 0738b4f9..33770652 100755
--- a/script/build_package.sh
+++ b/script/build_package.sh
@@ -1057,6 +1057,11 @@ apply_patch() {
echo "Applying ${1:?}..."
fi
+ if git apply --reverse --check < "$ci_root/patch/$1"; then
+ echo "Skipping already applied ${1:?}"
+ return 0
+ fi
+
if git apply < "$ci_root/patch/$1"; then
echo "$1" >> "${patch_record:?}"
else