Skip to content

Commit

Permalink
script: Enable SC2006 rule for Gitian scripts
Browse files Browse the repository at this point in the history
(cherry picked from commit bitcoin/bitcoin@577682d)
  • Loading branch information
hebasto authored and str4d committed Aug 20, 2022
1 parent 0f84499 commit fa3abe8
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 24 deletions.
12 changes: 6 additions & 6 deletions contrib/gitian-descriptors/gitian-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ script: |
export GZIP="-9n"
export TAR_OPTIONS="--mtime="$REFERENCE_DATE\\\ $REFERENCE_TIME""
export TZ="UTC"
export BUILD_DIR=`pwd`
export BUILD_DIR=$(pwd)
mkdir -p ${WRAP_DIR}
if test -n "$GBUILD_CACHE_ENABLED"; then
export SOURCES_PATH=${GBUILD_COMMON_CACHE}
Expand Down Expand Up @@ -86,7 +86,7 @@ script: |
create_per-host_faketime_wrappers "2000-01-01 12:00:00"
cd zcash
BASEPREFIX=`pwd`/depends
BASEPREFIX=$(pwd)/depends
# Build dependencies for each host
for i in $HOSTS; do
make ${MAKEOPTS} -C ${BASEPREFIX} HOST="${i}"
Expand All @@ -99,10 +99,10 @@ script: |
# Create the release tarball using (arbitrarily) the first host
export GIT_DIR="$PWD/.git"
./autogen.sh
CONFIG_SITE=${BASEPREFIX}/`echo "${HOSTS}" | awk '{print $1;}'`/share/config.site ./configure --prefix=/
CONFIG_SITE=${BASEPREFIX}/$(echo "${HOSTS}" | awk '{print $1;}')/share/config.site ./configure --prefix=/
make dist
SOURCEDIST=`echo zcash-*.tar.gz`
DISTNAME=`echo ${SOURCEDIST} | sed 's/.tar.*//'`
SOURCEDIST=$(echo zcash-*.tar.gz)
DISTNAME=$(echo ${SOURCEDIST} | sed 's/.tar.*//')
# Correct tar file order
mkdir -p temp
pushd temp
Expand All @@ -116,7 +116,7 @@ script: |
export PATH=${BASEPREFIX}/${i}/native/bin:${ORIGPATH}
mkdir -p distsrc-${i}
cd distsrc-${i}
INSTALLPATH=`pwd`/installed/${DISTNAME}
INSTALLPATH=$(pwd)/installed/${DISTNAME}
mkdir -p ${INSTALLPATH}
tar --strip-components=1 -xf ../$SOURCEDIST
Expand Down
2 changes: 1 addition & 1 deletion contrib/gitian-descriptors/gitian-osx-signer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ files:
script: |
WRAP_DIR=$HOME/wrapped
mkdir -p ${WRAP_DIR}
export PATH=`pwd`:$PATH
export PATH=$(pwd):$PATH
FAKETIME_PROGS="dmg genisoimage"
# Create global faketime wrappers
Expand Down
12 changes: 6 additions & 6 deletions contrib/gitian-descriptors/gitian-osx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ script: |
export GZIP="-9n"
export TAR_OPTIONS="--mtime="$REFERENCE_DATE\\\ $REFERENCE_TIME""
export TZ="UTC"
export BUILD_DIR=`pwd`
export BUILD_DIR=$(pwd)
mkdir -p ${WRAP_DIR}
if test -n "$GBUILD_CACHE_ENABLED"; then
export SOURCES_PATH=${GBUILD_COMMON_CACHE}
Expand Down Expand Up @@ -77,7 +77,7 @@ script: |
create_per-host_faketime_wrappers "2000-01-01 12:00:00"
cd bitcoin
BASEPREFIX=`pwd`/depends
BASEPREFIX=$(pwd)/depends
mkdir -p ${BASEPREFIX}/SDKs
tar -C ${BASEPREFIX}/SDKs -xf ${BUILD_DIR}/Xcode-11.3.1-11C505-extracted-SDK-with-libcxx-headers.tar.gz
Expand All @@ -94,10 +94,10 @@ script: |
# Create the release tarball using (arbitrarily) the first host
export GIT_DIR="$PWD/.git"
./autogen.sh
CONFIG_SITE=${BASEPREFIX}/`echo "${HOSTS}" | awk '{print $1;}'`/share/config.site ./configure --prefix=/
CONFIG_SITE=${BASEPREFIX}/$(echo "${HOSTS}" | awk '{print $1;}')/share/config.site ./configure --prefix=/
make dist
SOURCEDIST=`echo bitcoin-*.tar.gz`
DISTNAME=`echo ${SOURCEDIST} | sed 's/.tar.*//'`
SOURCEDIST=$(echo bitcoin-*.tar.gz)
DISTNAME=$(echo ${SOURCEDIST} | sed 's/.tar.*//')
# Correct tar file order
mkdir -p temp
Expand All @@ -112,7 +112,7 @@ script: |
export PATH=${BASEPREFIX}/${i}/native/bin:${ORIGPATH}
mkdir -p distsrc-${i}
cd distsrc-${i}
INSTALLPATH=`pwd`/installed/${DISTNAME}
INSTALLPATH=$(pwd)/installed/${DISTNAME}
mkdir -p ${INSTALLPATH}
tar --strip-components=1 -xf ../$SOURCEDIST
Expand Down
6 changes: 3 additions & 3 deletions contrib/gitian-descriptors/gitian-win-signer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ files:
- "osslsigncode-Backports-to-1.7.1.patch"
- "bitcoin-win-unsigned.tar.gz"
script: |
BUILD_DIR=`pwd`
BUILD_DIR=$(pwd)
SIGDIR=${BUILD_DIR}/signature/win
UNSIGNED_DIR=${BUILD_DIR}/unsigned
Expand All @@ -32,7 +32,7 @@ script: |
./configure --without-gsf --without-curl --disable-dependency-tracking
make
find ${UNSIGNED_DIR} -name "*-unsigned.exe" | while read i; do
INFILE="`basename "${i}"`"
OUTFILE="`echo "${INFILE}" | sed s/-unsigned//`"
INFILE="$(basename "${i}")"
OUTFILE="$(echo "${INFILE}" | sed s/-unsigned//)"
./osslsigncode attach-signature -in "${i}" -out "${OUTDIR}/${OUTFILE}" -sigin "${SIGDIR}/${INFILE}.pem"
done
13 changes: 6 additions & 7 deletions contrib/gitian-descriptors/gitian-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ script: |
export GZIP="-9n"
export TAR_OPTIONS="--mtime="$REFERENCE_DATE\\\ $REFERENCE_TIME""
export TZ="UTC"
export BUILD_DIR=`pwd`
export BUILD_DIR=$(pwd)
mkdir -p ${WRAP_DIR}
if test -n "$GBUILD_CACHE_ENABLED"; then
export SOURCES_PATH=${GBUILD_COMMON_CACHE}
Expand Down Expand Up @@ -101,7 +101,7 @@ script: |
create_per-host_linker_wrapper "2000-01-01 12:00:00"
cd bitcoin
BASEPREFIX=`pwd`/depends
BASEPREFIX=$(pwd)/depends
# Build dependencies for each host
for i in $HOSTS; do
make ${MAKEOPTS} -C ${BASEPREFIX} HOST="${i}"
Expand All @@ -115,11 +115,10 @@ script: |
# Create the release tarball using (arbitrarily) the first host
export GIT_DIR="$PWD/.git"
./autogen.sh
CONFIG_SITE=${BASEPREFIX}/`echo "${HOSTS}" | awk '{print $1;}'`/share/config.site ./configure --prefix=/
CONFIG_SITE=${BASEPREFIX}/$(echo "${HOSTS}" | awk '{print $1;}')/share/config.site ./configure --prefix=/
make dist
SOURCEDIST=`echo bitcoin-*.tar.gz`
DISTNAME=`echo ${SOURCEDIST} | sed 's/.tar.*//'`
SOURCEDIST=$(echo bitcoin-*.tar.gz)
DISTNAME=$(echo ${SOURCEDIST} | sed 's/.tar.*//')
# Correct tar file order
mkdir -p temp
pushd temp
Expand All @@ -135,7 +134,7 @@ script: |
export PATH=${BASEPREFIX}/${i}/native/bin:${ORIGPATH}
mkdir -p distsrc-${i}
cd distsrc-${i}
INSTALLPATH=`pwd`/installed/${DISTNAME}
INSTALLPATH=$(pwd)/installed/${DISTNAME}
mkdir -p ${INSTALLPATH}
tar --strip-components=1 -xf ../$SOURCEDIST
Expand Down
1 change: 0 additions & 1 deletion test/lint/lint-shell.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ disabled=(
)
disabled_gitian=(
SC2001 # See if you can use ${variable//search/replace} instead.
SC2006 # Use $(...) notation instead of legacy backticked `...`.
SC2035 # Use ./*glob* or -- *glob* so names with dashes won't become options.
SC2043 # This loop will only ever run once for a constant value. Did you perhaps mean to loop over dir/*, $var or $(cmd)?
SC2094 # Make sure not to read and write the same file in the same pipeline.
Expand Down

0 comments on commit fa3abe8

Please sign in to comment.