]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
mkosi: move variable to the right scope
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 6 Jun 2024 11:23:17 +0000 (13:23 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 28 Jun 2024 09:48:25 +0000 (11:48 +0200)
mkosi.images/system/mkosi.sync

index d21ecd198081cf5b304e0aaa292f4e3508a92719..fef0e3b138175b1a3f61e0d385f751ed043a0ef0 100755 (executable)
@@ -13,16 +13,16 @@ if [[ -d "$PKG_SUBDIR/.git" ]] && [[ "$(git -C "$PKG_SUBDIR" rev-parse HEAD)" ==
     exit 0
 fi
 
-# The repository on Salsa has the full upstream sources, so it's a waste of space to
-# redownload and duplicate everything, so do a sparse checkout as we only need the
-# packaging directory anyway
-if [[ -n "${GIT_SUBDIR:-}" ]]; then
-    sparse=(--no-checkout --filter=tree:0)
-else
-    sparse=()
-fi
-
 if [[ ! -e "$PKG_SUBDIR" ]] || [[ -z "$(ls --almost-all "$PKG_SUBDIR")" ]]; then
+    # The repository on Salsa has the full upstream sources, so it's a waste of
+    # space to redownload and duplicate everything, so do a sparse checkout as
+    # we only need the packaging directory anyway.
+    if [[ -n "${GIT_SUBDIR:-}" ]]; then
+        sparse=(--no-checkout --filter=tree:0)
+    else
+        sparse=()
+    fi
+
     git clone "$GIT_URL" --branch "$GIT_BRANCH" "${sparse[@]}" "$PKG_SUBDIR"
     if [[ -n "${GIT_SUBDIR:-}" ]]; then
         # --no-cone is needed to check out only one top-level directory