summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaan De Meyer <daan.j.demeyer@gmail.com>2024-07-02 22:27:01 +0200
committerLuca Boccassi <luca.boccassi@gmail.com>2024-07-03 01:17:35 +0200
commit88e92306431bd5928ab4e5c18310e36de9ffa3f6 (patch)
treef445977a0a9908a2a911fb2aefe10703461ca676
parentmeson: Define __TARGET_ARCH macros required by bpf (diff)
downloadsystemd-88e92306431bd5928ab4e5c18310e36de9ffa3f6.tar.xz
systemd-88e92306431bd5928ab4e5c18310e36de9ffa3f6.zip
mkosi: Don't touch the packaging checkout if work is being done
If work is being done in a separate branch, don't touch the packaging checkout.
-rwxr-xr-xmkosi.images/system/mkosi.sync11
1 files changed, 9 insertions, 2 deletions
diff --git a/mkosi.images/system/mkosi.sync b/mkosi.images/system/mkosi.sync
index fef0e3b138..d00a776257 100755
--- a/mkosi.images/system/mkosi.sync
+++ b/mkosi.images/system/mkosi.sync
@@ -9,8 +9,15 @@ fi
PKG_SUBDIR="$(realpath --canonicalize-missing "pkg/$DISTRIBUTION" --relative-to "$PWD")"
-if [[ -d "$PKG_SUBDIR/.git" ]] && [[ "$(git -C "$PKG_SUBDIR" rev-parse HEAD)" == "$GIT_COMMIT" ]]; then
- exit 0
+if [[ -d "$PKG_SUBDIR/.git" ]]; then
+ if [[ "$(git -C "$PKG_SUBDIR" rev-parse HEAD)" == "$GIT_COMMIT" ]]; then
+ exit 0
+ fi
+
+ # If work is being done on the packaging rules in a separate branch, don't touch the checkout.
+ if ! git merge-base --is-ancestor HEAD "origin/$GIT_BRANCH"; then
+ exit 0
+ fi
fi
if [[ ! -e "$PKG_SUBDIR" ]] || [[ -z "$(ls --almost-all "$PKG_SUBDIR")" ]]; then