]> git.ipfire.org Git - thirdparty/git.git/commitdiff
ci: skip unavailable external software
authorJunio C Hamano <gitster@pobox.com>
Thu, 24 Apr 2025 23:10:47 +0000 (16:10 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 24 Apr 2025 23:12:09 +0000 (16:12 -0700)
The ci/install-dependencies.sh script used in a very early phase of
our CI jobs downloads Perforce, Git-LFS, and JGit, used for running
the test scripts.  The test framework is prepared to properly skip
the tests that depend on these external software, but the CI script
is unnecessarily strict (due to its use of "set -e" in ci/lib.sh)
and fails the entire CI run before even starting to test the rest of
the system.

Notice a failure to download to any of these external software, but
keep going.  We need to be careful about cleaning after a failed
wget, as a later part of the script that does:

        if type jgit >/dev/null 2>&1
        then
                echo "$(tput setaf 6)JGit Version$(tput sgr0)"
                jgit version
        else
                echo >&2 "WARNING: JGit wasn't installed, see above for clues why"
        fi

will (surprise!) succeed running "type jgit", and then fail with
"jgit version", taking the whole thing down due to "set -e".

Signed-off-by: Junio C Hamano <gitster@pobox.com>
ci/install-dependencies.sh

index 0df74610d063fb8793ea1774f030b84dc1338979..e51304c3b0eed2dbb6c14b6db02b017280ce5384 100755 (executable)
@@ -66,16 +66,29 @@ ubuntu-*|i386/ubuntu-*|debian-*)
                mkdir --parents "$CUSTOM_PATH"
 
                wget --quiet --directory-prefix="$CUSTOM_PATH" \
-                       "$P4WHENCE/bin.linux26x86_64/p4d" "$P4WHENCE/bin.linux26x86_64/p4"
-               chmod a+x "$CUSTOM_PATH/p4d" "$CUSTOM_PATH/p4"
-
-               wget --quiet "$LFSWHENCE/git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz"
+                       "$P4WHENCE/bin.linux26x86_64/p4d" \
+                       "$P4WHENCE/bin.linux26x86_64/p4" &&
+               chmod a+x "$CUSTOM_PATH/p4d" "$CUSTOM_PATH/p4" || {
+                       rm -f "$CUSTOM_PATH/p4"
+                       rm -f "$CUSTOM_PATH/p4d"
+                       echo >&2 "P4 download (optional) failed"
+               }
+
+               wget --quiet \
+                    "$LFSWHENCE/git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz" &&
                tar -xzf "git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz" \
-                       -C "$CUSTOM_PATH" --strip-components=1 "git-lfs-$LINUX_GIT_LFS_VERSION/git-lfs"
-               rm "git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz"
-
-               wget --quiet "$JGITWHENCE" --output-document="$CUSTOM_PATH/jgit"
-               chmod a+x "$CUSTOM_PATH/jgit"
+                       -C "$CUSTOM_PATH" --strip-components=1 \
+                       "git-lfs-$LINUX_GIT_LFS_VERSION/git-lfs" &&
+               rm "git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz" || {
+                       rm -f "$CUSTOM_PATH/git-lfs"
+                       echo >&2 "LFS download (optional) failed"
+               }
+
+               wget --quiet "$JGITWHENCE" --output-document="$CUSTOM_PATH/jgit" &&
+               chmod a+x "$CUSTOM_PATH/jgit" || {
+                       rm -f "$CUSTOM_PATH/jgit"
+                       echo >&2 "JGit download (optional) failed"
+               }
                ;;
        esac
        ;;