diff options
author | Leah Rowe <leah@libreboot.org> | 2025-10-17 14:02:55 +0100 |
---|---|---|
committer | Leah Rowe <leah@libreboot.org> | 2025-10-17 14:02:55 +0100 |
commit | b3232a7c4a6466381d798d7beda56fd020d86d54 (patch) | |
tree | 73589e744d46ec1b37028a9e2d773fa53411f0d2 | |
parent | 54aa5b7d329526152c915d5a8603107248cf0a09 (diff) |
get.sh: make forcepull a macro
:
Signed-off-by: Leah Rowe <leah@libreboot.org>
-rw-r--r-- | include/get.sh | 9 | ||||
-rw-r--r-- | include/tree.sh | 3 |
2 files changed, 7 insertions, 5 deletions
diff --git a/include/get.sh b/include/get.sh index e3e4c311..1c5ae58c 100644 --- a/include/get.sh +++ b/include/get.sh @@ -3,6 +3,9 @@ # Copyright (c) 2020-2021,2023-2025 Leah Rowe <leah@libreboot.org> # Copyright (c) 2022 Caleb La Grange <thonkpeasant@protonmail.com> +# macro; ./mk -F sets it to : +if_not_force_pull="" + url="" bkup_url="" @@ -311,14 +314,14 @@ try_git() x_ mv "$tmpgitcache" "$gitdest" fi - if git -C "$gitdest" show "$7" 1>/dev/null 2>/dev/null && \ - [ "$forcepull" != "y" ]; then + if git -C "$gitdest" show "$7" 1>/dev/null 2>/dev/null; then # don't try to pull the latest changes if the given target # revision already exists locally. this saves a lot of time # during release builds, and reduces the chance that we will # interact with grub.git or gnulib.git overall during runtime - return 0 + $if_not_force_pull \ + return 0 fi if [ "$XBMK_CACHE_MIRROR" = "y" ]; then diff --git a/include/tree.sh b/include/tree.sh index 166a3d86..51e55421 100644 --- a/include/tree.sh +++ b/include/tree.sh @@ -26,7 +26,6 @@ cmd="" defconfig="" dest_dir="" elfdir="" -forcepull="" gccdir="" gccfull="" gccver="" @@ -93,7 +92,7 @@ trees() if [ "$flag" = "-F" ]; then # don't skip git fetch/pull on cached src - forcepull="y" + if_not_force_pull=":" fi ;; -s) mode="savedefconfig" ;; |