Skip to content

Commit 40c60f4

Browse files
pks-tgitster
authored andcommitted
ci: convert "install-dependencies.sh" to use "/bin/sh"
We're about to merge the "install-docker-dependencies.sh" script into "install-dependencies.sh". This will also move our Alpine-based jobs over to use the latter script. This script uses the Bash shell though, which is not available by default on Alpine Linux. Refactor "install-dependencies.sh" to use "/bin/sh" instead of Bash. This requires us to get rid of the pushd/popd invocations, which are replaced by some more elaborate commands that download or extract executables right to where they are needed. Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 21bcb4a commit 40c60f4

File tree

1 file changed

+12
-17
lines changed

1 file changed

+12
-17
lines changed

ci/install-dependencies.sh

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env bash
1+
#!/bin/sh
22
#
33
# Install dependencies required to build and test Git on Linux and macOS
44
#
@@ -30,19 +30,15 @@ ubuntu-*)
3030
$CC_PACKAGE $PYTHON_PACKAGE
3131

3232
mkdir --parents "$P4_PATH"
33-
pushd "$P4_PATH"
34-
wget --quiet "$P4WHENCE/bin.linux26x86_64/p4d"
35-
wget --quiet "$P4WHENCE/bin.linux26x86_64/p4"
36-
chmod u+x p4d
37-
chmod u+x p4
38-
popd
33+
wget --quiet --directory-prefix="$P4_PATH" \
34+
"$P4WHENCE/bin.linux26x86_64/p4d" "$P4WHENCE/bin.linux26x86_64/p4"
35+
chmod u+x "$P4_PATH/p4d" "$P4_PATH/p4"
3936

4037
mkdir --parents "$GIT_LFS_PATH"
41-
pushd "$GIT_LFS_PATH"
42-
wget --quiet "$LFSWHENCE/git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz"
43-
tar --extract --gunzip --file "git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz"
44-
cp git-lfs-$LINUX_GIT_LFS_VERSION/git-lfs .
45-
popd
38+
wget --quiet "$LFSWHENCE/git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz"
39+
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"
41+
rm "git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz"
4642
;;
4743
macos-*)
4844
export HOMEBREW_NO_AUTO_UPDATE=1 HOMEBREW_NO_INSTALL_CLEANUP=1
@@ -53,11 +49,10 @@ macos-*)
5349
brew link --force gettext
5450

5551
mkdir -p "$P4_PATH"
56-
pushd "$P4_PATH"
57-
wget -q "$P4WHENCE/bin.macosx1015x86_64/helix-core-server.tgz" &&
58-
tar -xf helix-core-server.tgz &&
59-
sudo xattr -d com.apple.quarantine p4 p4d 2>/dev/null || true
60-
popd
52+
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
55+
rm helix-core-server.tgz
6156

6257
if test -n "$CC_PACKAGE"
6358
then

0 commit comments

Comments
 (0)