summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2025-05-25 14:46:33 +0100
committerLeah Rowe <leah@libreboot.org>2025-05-25 14:46:33 +0100
commit2493203ee53befbf46de0ff7908214b5e64033a8 (patch)
tree2602496b4288b74744c0dc082cc0f4f966d75510
parentad333ae24810dcb762d5561d0b7d7dabec7c0eac (diff)
get.sh: Properly error out if tmpclone fails
We rely on a non-zero exit on other try_ commands, which works fine there because we then check the file afterward and error out accordingly. For git repositories, we assume that both mirrors are identical and therefore once we get to the first clone attempt, we assume that it must succeed. Therefore, if it does not succeed, we must fail. This fixes a regression I found in testing, where sometimes a failed patching attempt would not result in an error exit, and would therefore result in broken sources being present. In practise, I always very closely watch the terminal when testing xbmk, especially when updating project patches, so we probably didn't introduce any broken sources in practice. Signed-off-by: Leah Rowe <leah@libreboot.org>
-rw-r--r--include/get.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/get.sh b/include/get.sh
index 6f1b5f1d..3d06eb4a 100644
--- a/include/get.sh
+++ b/include/get.sh
@@ -111,7 +111,8 @@ try_file()
eval "[ -$echk \"$cached\" ] || return 1"
if [ "$2" = "git" ]; then
- [ -d "$5" ] || tmpclone "$cached" "$5" "$6" "$7" || return 1
+ [ -d "$5" ] || tmpclone "$cached" "$5" "$6" "$7" || \
+ err "Can't clone final repo in command: try_file $*"; :
else
bad_checksum "$6" "$cached" && x_ rm -f "$cached" && return 1
[ "$cached" != "$5" ] && x_ cp "$cached" "$5"