Skip to content

Commit 577682d

Browse files
committed
script: Enable SC2006 rule for Gitian scripts
1 parent 14aded4 commit 577682d

File tree

6 files changed

+23
-24
lines changed

6 files changed

+23
-24
lines changed

contrib/gitian-descriptors/gitian-linux.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ script: |
5151
export QT_RCC_TEST=1
5252
export QT_RCC_SOURCE_DATE_OVERRIDE=1
5353
export TZ="UTC"
54-
export BUILD_DIR=`pwd`
54+
export BUILD_DIR=$(pwd)
5555
mkdir -p ${WRAP_DIR}
5656
if test -n "$GBUILD_CACHE_ENABLED"; then
5757
export SOURCES_PATH=${GBUILD_COMMON_CACHE}
@@ -107,7 +107,7 @@ script: |
107107
rm -f ${WRAP_DIR}/${prog}
108108
cat << EOF > ${WRAP_DIR}/${prog}
109109
#!/usr/bin/env bash
110-
REAL="`which -a ${prog}-8 | grep -v ${WRAP_DIR}/${prog} | head -1`"
110+
REAL="$(which -a ${prog}-8 | grep -v ${WRAP_DIR}/${prog} | head -1)"
111111
for var in "\$@"
112112
do
113113
if [ "\$var" = "-m32" ]; then
@@ -122,7 +122,7 @@ script: |
122122
done
123123
124124
cd bitcoin
125-
BASEPREFIX=`pwd`/depends
125+
BASEPREFIX=$(pwd)/depends
126126
# Build dependencies for each host
127127
for i in $HOSTS; do
128128
EXTRA_INCLUDES="$EXTRA_INCLUDES_BASE/$i"
@@ -141,10 +141,10 @@ script: |
141141
142142
# Create the release tarball using (arbitrarily) the first host
143143
./autogen.sh
144-
CONFIG_SITE=${BASEPREFIX}/`echo "${HOSTS}" | awk '{print $1;}'`/share/config.site ./configure --prefix=/
144+
CONFIG_SITE=${BASEPREFIX}/$(echo "${HOSTS}" | awk '{print $1;}')/share/config.site ./configure --prefix=/
145145
make dist
146-
SOURCEDIST=`echo bitcoin-*.tar.gz`
147-
DISTNAME=`echo ${SOURCEDIST} | sed 's/.tar.*//'`
146+
SOURCEDIST=$(echo bitcoin-*.tar.gz)
147+
DISTNAME=$(echo ${SOURCEDIST} | sed 's/.tar.*//')
148148
# Correct tar file order
149149
mkdir -p temp
150150
pushd temp
@@ -161,7 +161,7 @@ script: |
161161
export PATH=${BASEPREFIX}/${i}/native/bin:${ORIGPATH}
162162
mkdir -p distsrc-${i}
163163
cd distsrc-${i}
164-
INSTALLPATH=`pwd`/installed/${DISTNAME}
164+
INSTALLPATH=$(pwd)/installed/${DISTNAME}
165165
mkdir -p ${INSTALLPATH}
166166
tar --strip-components=1 -xf ../$SOURCEDIST
167167

contrib/gitian-descriptors/gitian-osx-signer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ script: |
1717
1818
WRAP_DIR=$HOME/wrapped
1919
mkdir -p ${WRAP_DIR}
20-
export PATH=`pwd`:$PATH
20+
export PATH=$(pwd):$PATH
2121
FAKETIME_PROGS="dmg genisoimage"
2222
2323
# Create global faketime wrappers

contrib/gitian-descriptors/gitian-osx.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ script: |
4545
export QT_RCC_TEST=1
4646
export QT_RCC_SOURCE_DATE_OVERRIDE=1
4747
export TZ="UTC"
48-
export BUILD_DIR=`pwd`
48+
export BUILD_DIR=$(pwd)
4949
mkdir -p ${WRAP_DIR}
5050
if test -n "$GBUILD_CACHE_ENABLED"; then
5151
export SOURCES_PATH=${GBUILD_COMMON_CACHE}
@@ -86,7 +86,7 @@ script: |
8686
export PATH=${WRAP_DIR}:${PATH}
8787
8888
cd bitcoin
89-
BASEPREFIX=`pwd`/depends
89+
BASEPREFIX=$(pwd)/depends
9090
9191
mkdir -p ${BASEPREFIX}/SDKs
9292
tar -C ${BASEPREFIX}/SDKs -xf ${BUILD_DIR}/MacOSX10.11.sdk.tar.gz
@@ -104,10 +104,10 @@ script: |
104104
105105
# Create the release tarball using (arbitrarily) the first host
106106
./autogen.sh
107-
CONFIG_SITE=${BASEPREFIX}/`echo "${HOSTS}" | awk '{print $1;}'`/share/config.site ./configure --prefix=/
107+
CONFIG_SITE=${BASEPREFIX}/$(echo "${HOSTS}" | awk '{print $1;}')/share/config.site ./configure --prefix=/
108108
make dist
109-
SOURCEDIST=`echo bitcoin-*.tar.gz`
110-
DISTNAME=`echo ${SOURCEDIST} | sed 's/.tar.*//'`
109+
SOURCEDIST=$(echo bitcoin-*.tar.gz)
110+
DISTNAME=$(echo ${SOURCEDIST} | sed 's/.tar.*//')
111111
112112
# Correct tar file order
113113
mkdir -p temp
@@ -125,7 +125,7 @@ script: |
125125
export PATH=${BASEPREFIX}/${i}/native/bin:${ORIGPATH}
126126
mkdir -p distsrc-${i}
127127
cd distsrc-${i}
128-
INSTALLPATH=`pwd`/installed/${DISTNAME}
128+
INSTALLPATH=$(pwd)/installed/${DISTNAME}
129129
mkdir -p ${INSTALLPATH}
130130
tar --strip-components=1 -xf ../$SOURCEDIST
131131

contrib/gitian-descriptors/gitian-win-signer.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ files:
1919
script: |
2020
set -e -o pipefail
2121
22-
BUILD_DIR=`pwd`
22+
BUILD_DIR=$(pwd)
2323
SIGDIR=${BUILD_DIR}/signature/win
2424
UNSIGNED_DIR=${BUILD_DIR}/unsigned
2525
@@ -36,7 +36,7 @@ script: |
3636
./configure --without-gsf --without-curl --disable-dependency-tracking
3737
make
3838
find ${UNSIGNED_DIR} -name "*-unsigned.exe" | while read i; do
39-
INFILE="`basename "${i}"`"
40-
OUTFILE="`echo "${INFILE}" | sed s/-unsigned//`"
39+
INFILE="$(basename "${i}")"
40+
OUTFILE="$(echo "${INFILE}" | sed s/-unsigned//)"
4141
./osslsigncode attach-signature -in "${i}" -out "${OUTDIR}/${OUTFILE}" -sigin "${SIGDIR}/${INFILE}.pem"
4242
done

contrib/gitian-descriptors/gitian-win.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ script: |
4040
export QT_RCC_TEST=1
4141
export QT_RCC_SOURCE_DATE_OVERRIDE=1
4242
export TZ="UTC"
43-
export BUILD_DIR=`pwd`
43+
export BUILD_DIR=$(pwd)
4444
mkdir -p ${WRAP_DIR}
4545
if test -n "$GBUILD_CACHE_ENABLED"; then
4646
export SOURCES_PATH=${GBUILD_COMMON_CACHE}
@@ -96,7 +96,7 @@ script: |
9696
export PATH=${WRAP_DIR}:${PATH}
9797
9898
cd bitcoin
99-
BASEPREFIX=`pwd`/depends
99+
BASEPREFIX=$(pwd)/depends
100100
# Build dependencies for each host
101101
for i in $HOSTS; do
102102
make ${MAKEOPTS} -C ${BASEPREFIX} HOST="${i}"
@@ -111,10 +111,10 @@ script: |
111111
112112
# Create the release tarball using (arbitrarily) the first host
113113
./autogen.sh
114-
CONFIG_SITE=${BASEPREFIX}/`echo "${HOSTS}" | awk '{print $1;}'`/share/config.site ./configure --prefix=/
114+
CONFIG_SITE=${BASEPREFIX}/$(echo "${HOSTS}" | awk '{print $1;}')/share/config.site ./configure --prefix=/
115115
make dist
116-
SOURCEDIST=`echo bitcoin-*.tar.gz`
117-
DISTNAME=`echo ${SOURCEDIST} | sed 's/.tar.*//'`
116+
SOURCEDIST=$(echo bitcoin-*.tar.gz)
117+
DISTNAME=$(echo ${SOURCEDIST} | sed 's/.tar.*//')
118118
# Correct tar file order
119119
mkdir -p temp
120120
pushd temp
@@ -131,7 +131,7 @@ script: |
131131
export PATH=${BASEPREFIX}/${i}/native/bin:${ORIGPATH}
132132
mkdir -p distsrc-${i}
133133
cd distsrc-${i}
134-
INSTALLPATH=`pwd`/installed/${DISTNAME}
134+
INSTALLPATH=$(pwd)/installed/${DISTNAME}
135135
mkdir -p ${INSTALLPATH}
136136
tar --strip-components=1 -xf ../$SOURCEDIST
137137

test/lint/lint-shell.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ disabled=(
2424
)
2525
disabled_gitian=(
2626
SC2001 # See if you can use ${variable//search/replace} instead.
27-
SC2006 # Use $(...) notation instead of legacy backticked `...`.
2827
SC2094 # Make sure not to read and write the same file in the same pipeline.
2928
SC2129 # Consider using { cmd1; cmd2; } >> file instead of individual redirects.
3029
SC2155 # Declare and assign separately to avoid masking return values.

0 commit comments

Comments
 (0)