get.sh: make forcepull a macro

:

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2025-10-17 14:02:55 +01:00
parent 54aa5b7d32
commit b3232a7c4a
2 changed files with 7 additions and 5 deletions
+6 -3
View File
@@ -3,6 +3,9 @@
# Copyright (c) 2020-2021,2023-2025 Leah Rowe <leah@libreboot.org> # Copyright (c) 2020-2021,2023-2025 Leah Rowe <leah@libreboot.org>
# Copyright (c) 2022 Caleb La Grange <thonkpeasant@protonmail.com> # Copyright (c) 2022 Caleb La Grange <thonkpeasant@protonmail.com>
# macro; ./mk -F sets it to :
if_not_force_pull=""
url="" url=""
bkup_url="" bkup_url=""
@@ -311,14 +314,14 @@ try_git()
x_ mv "$tmpgitcache" "$gitdest" x_ mv "$tmpgitcache" "$gitdest"
fi fi
if git -C "$gitdest" show "$7" 1>/dev/null 2>/dev/null && \ if git -C "$gitdest" show "$7" 1>/dev/null 2>/dev/null; then
[ "$forcepull" != "y" ]; then
# don't try to pull the latest changes if the given target # don't try to pull the latest changes if the given target
# revision already exists locally. this saves a lot of time # revision already exists locally. this saves a lot of time
# during release builds, and reduces the chance that we will # during release builds, and reduces the chance that we will
# interact with grub.git or gnulib.git overall during runtime # interact with grub.git or gnulib.git overall during runtime
return 0 $if_not_force_pull \
return 0
fi fi
if [ "$XBMK_CACHE_MIRROR" = "y" ]; then if [ "$XBMK_CACHE_MIRROR" = "y" ]; then
+1 -2
View File
@@ -26,7 +26,6 @@ cmd=""
defconfig="" defconfig=""
dest_dir="" dest_dir=""
elfdir="" elfdir=""
forcepull=""
gccdir="" gccdir=""
gccfull="" gccfull=""
gccver="" gccver=""
@@ -93,7 +92,7 @@ trees()
if [ "$flag" = "-F" ]; then if [ "$flag" = "-F" ]; then
# don't skip git fetch/pull on cached src # don't skip git fetch/pull on cached src
forcepull="y" if_not_force_pull=":"
fi fi
;; ;;
-s) mode="savedefconfig" ;; -s) mode="savedefconfig" ;;