ci: merge custom PATH directories

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>

Patrick Steinhardt committed Apr 12, 2024 at 06:44 UTC d1ef3d3b1d562e3362de0886b18c8cc2df85c4b7
2 files changed +10 -15
ci/install-dependencies.sh
+7 -8
@@ -29,15 +29,14 @@ ubuntu-*)
29 libemail-valid-perl libio-socket-ssl-perl libnet-smtp-ssl-perl \
30 $CC_PACKAGE $PYTHON_PACKAGE
31
32 - mkdir --parents "$P4_PATH"
33 - wget --quiet --directory-prefix="$P4_PATH" \
32 + mkdir --parents "$CUSTOM_PATH"
33 + wget --quiet --directory-prefix="$CUSTOM_PATH" \
34 "$P4WHENCE/bin.linux26x86_64/p4d" "$P4WHENCE/bin.linux26x86_64/p4"
35 - chmod u+x "$P4_PATH/p4d" "$P4_PATH/p4"
35 + chmod u+x "$CUSTOM_PATH/p4d" "$CUSTOM_PATH/p4"
36
37 - mkdir --parents "$GIT_LFS_PATH"
37 wget --quiet "$LFSWHENCE/git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz"
38 tar -xzf "git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz" \
40 - -C "$GIT_LFS_PATH" --strip-components=1 "git-lfs-$LINUX_GIT_LFS_VERSION/git-lfs"
39 + -C "$CUSTOM_PATH" --strip-components=1 "git-lfs-$LINUX_GIT_LFS_VERSION/git-lfs"
40 rm "git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz"
41 ;;
42 macos-*)
@@ -48,10 +47,10 @@ macos-*)
47 brew install $BREW_INSTALL_PACKAGES
48 brew link --force gettext
49
51 - mkdir -p "$P4_PATH"
50 + mkdir -p "$CUSTOM_PATH"
51 wget -q "$P4WHENCE/bin.macosx1015x86_64/helix-core-server.tgz" &&
53 - tar -xf helix-core-server.tgz -C "$P4_PATH" p4 p4d &&
54 - sudo xattr -d com.apple.quarantine "$P4_PATH/p4" "$P4_PATH/p4d" 2>/dev/null || true
52 + tar -xf helix-core-server.tgz -C "$CUSTOM_PATH" p4 p4d &&
53 + sudo xattr -d com.apple.quarantine "$CUSTOM_PATH/p4" "$CUSTOM_PATH/p4d" 2>/dev/null || true
54 rm helix-core-server.tgz
55
56 if test -n "$CC_PACKAGE"
ci/lib.sh
+3 -7
@@ -340,10 +340,6 @@ ubuntu-*)
340 # image.
341 # Keep that in mind when you encounter a broken OS X build!
342 export LINUX_GIT_LFS_VERSION="1.5.2"
343 -
344 - P4_PATH="$HOME/custom/p4"
345 - GIT_LFS_PATH="$HOME/custom/git-lfs"
346 - export PATH="$GIT_LFS_PATH:$P4_PATH:$PATH"
343 ;;
344 macos-*)
345 MAKEFLAGS="$MAKEFLAGS PYTHON_PATH=$(which python3)"
@@ -351,12 +347,12 @@ macos-*)
347 then
348 MAKEFLAGS="$MAKEFLAGS APPLE_COMMON_CRYPTO_SHA1=Yes"
349 fi
354 -
355 - P4_PATH="$HOME/custom/p4"
356 - export PATH="$P4_PATH:$PATH"
350 ;;
351 esac
352
353 +CUSTOM_PATH="$HOME/path"
354 +export PATH="$CUSTOM_PATH:$PATH"
355 +
356 case "$jobname" in
357 linux32)
358 CC=gcc