Re: [PATCH v2 05/12] ci: convert "install-dependencies.sh" to use "/bin/sh"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Apr 10, 2024 at 03:46:49PM -0500, Justin Tobler wrote:
> On 24/04/08 08:46AM, Patrick Steinhardt wrote:
> > 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@xxxxxx>
> > ---
> >  ci/install-dependencies.sh | 28 +++++++++++-----------------
> >  1 file changed, 11 insertions(+), 17 deletions(-)
> > 
> > diff --git a/ci/install-dependencies.sh b/ci/install-dependencies.sh
> > index fad53aac96..7bcccc96fd 100755
> > --- a/ci/install-dependencies.sh
> > +++ b/ci/install-dependencies.sh
> > @@ -1,4 +1,4 @@
> > -#!/usr/bin/env bash
> > +#!/bin/sh
> >  #
> >  # Install dependencies required to build and test Git on Linux and macOS
> >  #
> > @@ -30,19 +30,14 @@ ubuntu-*)
> >  		$CC_PACKAGE $PYTHON_PACKAGE
> >  
> >  	mkdir --parents "$P4_PATH"
> > -	pushd "$P4_PATH"
> > -		wget --quiet "$P4WHENCE/bin.linux26x86_64/p4d"
> > -		wget --quiet "$P4WHENCE/bin.linux26x86_64/p4"
> > -		chmod u+x p4d
> > -		chmod u+x p4
> > -	popd
> > +	wget --quiet --directory-prefix="$P4_PATH" \
> > +		"$P4WHENCE/bin.linux26x86_64/p4d" "$P4WHENCE/bin.linux26x86_64/p4"
> > +	chmod u+x "$P4_PATH/p4d" "$P4_PATH/p4"
> >  
> >  	mkdir --parents "$GIT_LFS_PATH"
> > -	pushd "$GIT_LFS_PATH"
> > -		wget --quiet "$LFSWHENCE/git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz"
> > -		tar --extract --gunzip --file "git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz"
> > -		cp git-lfs-$LINUX_GIT_LFS_VERSION/git-lfs .
> > -	popd
> > +	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"
> 
> Do we want to fold this line since it is rather long?
> 
> -Justin

Yeah, let's.

Patrick

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux