]> git.ipfire.org Git - thirdparty/git.git/commitdiff
ci: merge custom PATH directories
authorPatrick Steinhardt <ps@pks.im>
Fri, 12 Apr 2024 04:44:22 +0000 (06:44 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 12 Apr 2024 15:47:50 +0000 (08:47 -0700)
We're downloading various executables required by our tests. Each of
these executables goes into its own directory, which is then appended to
the PATH variable. Consequently, whenever we add a new dependency and
thus a new directory, we would have to adapt to this change in several
places.

Refactor this to instead put all binaries into a single directory.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
ci/install-dependencies.sh
ci/lib.sh

index 2d6af876d64675dfef54c197d103a32144db87f0..bafe37f2d1059170076a60c5796dc47ef2fc95cb 100755 (executable)
@@ -29,15 +29,14 @@ ubuntu-*)
                libemail-valid-perl libio-socket-ssl-perl libnet-smtp-ssl-perl \
                $CC_PACKAGE $PYTHON_PACKAGE
 
-       mkdir --parents "$P4_PATH"
-       wget --quiet --directory-prefix="$P4_PATH" \
+       mkdir --parents "$CUSTOM_PATH"
+       wget --quiet --directory-prefix="$CUSTOM_PATH" \
                "$P4WHENCE/bin.linux26x86_64/p4d" "$P4WHENCE/bin.linux26x86_64/p4"
-       chmod u+x "$P4_PATH/p4d" "$P4_PATH/p4"
+       chmod u+x "$CUSTOM_PATH/p4d" "$CUSTOM_PATH/p4"
 
-       mkdir --parents "$GIT_LFS_PATH"
        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 "$GIT_LFS_PATH" --strip-components=1 "git-lfs-$LINUX_GIT_LFS_VERSION/git-lfs"
+               -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"
        ;;
 macos-*)
@@ -48,10 +47,10 @@ macos-*)
        brew install $BREW_INSTALL_PACKAGES
        brew link --force gettext
 
-       mkdir -p "$P4_PATH"
+       mkdir -p "$CUSTOM_PATH"
        wget -q "$P4WHENCE/bin.macosx1015x86_64/helix-core-server.tgz" &&
-       tar -xf helix-core-server.tgz -C "$P4_PATH" p4 p4d &&
-       sudo xattr -d com.apple.quarantine "$P4_PATH/p4" "$P4_PATH/p4d" 2>/dev/null || true
+       tar -xf helix-core-server.tgz -C "$CUSTOM_PATH" p4 p4d &&
+       sudo xattr -d com.apple.quarantine "$CUSTOM_PATH/p4" "$CUSTOM_PATH/p4d" 2>/dev/null || true
        rm helix-core-server.tgz
 
        if test -n "$CC_PACKAGE"
index d882250db55dc44df3253483aba9a6fc53e14f0e..4cce854bad10f6b76f9aac4c4b50c332768fd51d 100755 (executable)
--- a/ci/lib.sh
+++ b/ci/lib.sh
@@ -340,10 +340,6 @@ ubuntu-*)
        # image.
        # Keep that in mind when you encounter a broken OS X build!
        export LINUX_GIT_LFS_VERSION="1.5.2"
-
-       P4_PATH="$HOME/custom/p4"
-       GIT_LFS_PATH="$HOME/custom/git-lfs"
-       export PATH="$GIT_LFS_PATH:$P4_PATH:$PATH"
        ;;
 macos-*)
        MAKEFLAGS="$MAKEFLAGS PYTHON_PATH=$(which python3)"
@@ -351,12 +347,12 @@ macos-*)
        then
                MAKEFLAGS="$MAKEFLAGS APPLE_COMMON_CRYPTO_SHA1=Yes"
        fi
-
-       P4_PATH="$HOME/custom/p4"
-       export PATH="$P4_PATH:$PATH"
        ;;
 esac
 
+CUSTOM_PATH="$HOME/path"
+export PATH="$CUSTOM_PATH:$PATH"
+
 case "$jobname" in
 linux32)
        CC=gcc