From 2493203ee53befbf46de0ff7908214b5e64033a8 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sun, 25 May 2025 14:46:33 +0100 Subject: 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 --- include/get.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include/get.sh') 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" -- cgit v1.2.1