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 <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
21bcb4a602
commit
40c60f4c12
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/env bash
|
#!/bin/sh
|
||||||
#
|
#
|
||||||
# Install dependencies required to build and test Git on Linux and macOS
|
# Install dependencies required to build and test Git on Linux and macOS
|
||||||
#
|
#
|
||||||
@ -30,19 +30,15 @@ ubuntu-*)
|
|||||||
$CC_PACKAGE $PYTHON_PACKAGE
|
$CC_PACKAGE $PYTHON_PACKAGE
|
||||||
|
|
||||||
mkdir --parents "$P4_PATH"
|
mkdir --parents "$P4_PATH"
|
||||||
pushd "$P4_PATH"
|
wget --quiet --directory-prefix="$P4_PATH" \
|
||||||
wget --quiet "$P4WHENCE/bin.linux26x86_64/p4d"
|
"$P4WHENCE/bin.linux26x86_64/p4d" "$P4WHENCE/bin.linux26x86_64/p4"
|
||||||
wget --quiet "$P4WHENCE/bin.linux26x86_64/p4"
|
chmod u+x "$P4_PATH/p4d" "$P4_PATH/p4"
|
||||||
chmod u+x p4d
|
|
||||||
chmod u+x p4
|
|
||||||
popd
|
|
||||||
|
|
||||||
mkdir --parents "$GIT_LFS_PATH"
|
mkdir --parents "$GIT_LFS_PATH"
|
||||||
pushd "$GIT_LFS_PATH"
|
wget --quiet "$LFSWHENCE/git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz"
|
||||||
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" \
|
||||||
tar --extract --gunzip --file "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"
|
||||||
cp git-lfs-$LINUX_GIT_LFS_VERSION/git-lfs .
|
rm "git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz"
|
||||||
popd
|
|
||||||
;;
|
;;
|
||||||
macos-*)
|
macos-*)
|
||||||
export HOMEBREW_NO_AUTO_UPDATE=1 HOMEBREW_NO_INSTALL_CLEANUP=1
|
export HOMEBREW_NO_AUTO_UPDATE=1 HOMEBREW_NO_INSTALL_CLEANUP=1
|
||||||
@ -53,11 +49,10 @@ macos-*)
|
|||||||
brew link --force gettext
|
brew link --force gettext
|
||||||
|
|
||||||
mkdir -p "$P4_PATH"
|
mkdir -p "$P4_PATH"
|
||||||
pushd "$P4_PATH"
|
wget -q "$P4WHENCE/bin.macosx1015x86_64/helix-core-server.tgz" &&
|
||||||
wget -q "$P4WHENCE/bin.macosx1015x86_64/helix-core-server.tgz" &&
|
tar -xf helix-core-server.tgz -C "$P4_PATH" p4 p4d &&
|
||||||
tar -xf helix-core-server.tgz &&
|
sudo xattr -d com.apple.quarantine "$P4_PATH/p4" "$P4_PATH/p4d" 2>/dev/null || true
|
||||||
sudo xattr -d com.apple.quarantine p4 p4d 2>/dev/null || true
|
rm helix-core-server.tgz
|
||||||
popd
|
|
||||||
|
|
||||||
if test -n "$CC_PACKAGE"
|
if test -n "$CC_PACKAGE"
|
||||||
then
|
then
|
||||||
|
Reference in New Issue
Block a user