Skip to content

Commit 27754d3

Browse files
committed
Quote stuff properly
1 parent 566d49a commit 27754d3

27 files changed

+124
-124
lines changed

.circleci/soltest.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ set -e
3636

3737
OPTIMIZE=${OPTIMIZE:-"0"}
3838
EVM=${EVM:-"invalid"}
39-
REPODIR="$(realpath $(dirname $0)/..)"
39+
REPODIR="$(realpath "$(dirname "$0")/..")"
4040

4141
source "${REPODIR}/scripts/common.sh"
4242
# Test result output directory (CircleCI is reading test results from here)
@@ -60,4 +60,4 @@ test "${ABI_ENCODER_V1}" = "1" && SOLTEST_ARGS="${SOLTEST_ARGS} --abiencoderv1"
6060

6161
echo "Running ${REPODIR}/build/test/soltest ${BOOST_TEST_ARGS} -- ${SOLTEST_ARGS}"
6262

63-
${REPODIR}/build/test/soltest ${BOOST_TEST_ARGS} -- ${SOLTEST_ARGS}
63+
"${REPODIR}/build/test/soltest" ${BOOST_TEST_ARGS} -- ${SOLTEST_ARGS}

.circleci/soltest_all.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
# ------------------------------------------------------------------------------
2727
set -e
2828

29-
REPODIR="$(realpath $(dirname $0)/..)"
29+
REPODIR="$(realpath "$(dirname "$0")"/..)"
3030

3131
EVM_VALUES=(homestead byzantium constantinople petersburg istanbul)
3232
OPTIMIZE_VALUES=(0 1)
@@ -65,9 +65,9 @@ STEP=$(($STEP + 1))
6565
[[ " $RUN_STEPS " =~ " $STEP " ]] && EVM=istanbul OPTIMIZE=1 ABI_ENCODER_V1=1 BOOST_TEST_ARGS="-t !smtCheckerTests" "${REPODIR}/.circleci/soltest.sh"
6666
STEP=$(($STEP + 1))
6767

68-
for OPTIMIZE in ${OPTIMIZE_VALUES[@]}
68+
for OPTIMIZE in "${OPTIMIZE_VALUES[@]}"
6969
do
70-
for EVM in ${EVM_VALUES[@]}
70+
for EVM in "${EVM_VALUES[@]}"
7171
do
7272
# run tests against hera ewasm evmc vm, only if OPTIMIZE == 0 and evm version is byzantium
7373
EWASM_ARGS=""

scripts/ASTImportTest.sh

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ SPLITSOURCES=${REPO_ROOT}/scripts/splitSources.py
1616

1717
SYNTAXTESTS_DIR="${REPO_ROOT}/test/libsolidity/syntaxTests"
1818
ASTJSONTESTS_DIR="${REPO_ROOT}/test/libsolidity/ASTJSON"
19-
NSOURCES="$(find $SYNTAXTESTS_DIR -type f | wc -l)"
19+
NSOURCES="$(find "$SYNTAXTESTS_DIR" -type f | wc -l)"
2020

2121
# DEV_DIR="${REPO_ROOT}/../tmp/contracts/"
2222
# NSOURCES="$(find $DEV_DIR -type f | wc -l)" #TODO use find command
@@ -25,7 +25,7 @@ FAILED=0
2525
UNCOMPILABLE=0
2626
TESTED=0
2727

28-
if [ $(ls | wc -l) -ne 0 ]; then
28+
if [ "$(ls | wc -l)" -ne 0 ]; then
2929
echo "Test directory not empty. Skipping!"
3030
exit -1
3131
fi
@@ -37,10 +37,10 @@ fi
3737
# $1 name of the file to be exported and imported
3838
# $2 any files needed to do so that might be in parent directories
3939
function testImportExportEquivalence {
40-
if $SOLC $1 $2 > /dev/null 2>&1
40+
if $SOLC "$1" $2 > /dev/null 2>&1
4141
then
4242
# save exported json as expected result (silently)
43-
$SOLC --combined-json ast,compact-format --pretty-json $1 $2> expected.json 2> /dev/null
43+
$SOLC --combined-json ast,compact-format --pretty-json "$1" $2 > expected.json 2> /dev/null
4444
# import it, and export it again as obtained result (silently)
4545
$SOLC --import-ast --combined-json ast,compact-format --pretty-json expected.json > obtained.json 2> /dev/null
4646
if [ $? -ne 0 ]
@@ -81,15 +81,15 @@ echo "Looking at $NSOURCES .sol files..."
8181
WORKINGDIR=$PWD
8282

8383
# for solfile in $(find $DEV_DIR -name *.sol)
84-
for solfile in $(find $SYNTAXTESTS_DIR $ASTJSONTESTS_DIR -name *.sol)
84+
for solfile in $(find "$SYNTAXTESTS_DIR" "$ASTJSONTESTS_DIR" -name *.sol)
8585
do
8686
echo -n "."
8787
# create a temporary sub-directory
8888
FILETMP=$(mktemp -d)
89-
cd $FILETMP
89+
cd "$FILETMP"
9090

9191
set +e
92-
OUTPUT=$($SPLITSOURCES $solfile)
92+
OUTPUT=$("$SPLITSOURCES" "$solfile")
9393
SPLITSOURCES_RC=$?
9494
set -e
9595
if [ ${SPLITSOURCES_RC} == 0 ]
@@ -103,29 +103,29 @@ do
103103
done
104104
elif [ ${SPLITSOURCES_RC} == 1 ]
105105
then
106-
testImportExportEquivalence $solfile
106+
testImportExportEquivalence "$solfile"
107107
elif [ ${SPLITSOURCES_RC} == 2 ]
108108
then
109109
# The script will exit with return code 2, if an UnicodeDecodeError occurred.
110110
# This is the case if e.g. some tests are using invalid utf-8 sequences. We will ignore
111111
# these errors, but print the actual output of the script.
112112
echo -e "\n${OUTPUT}\n"
113-
testImportExportEquivalence $solfile
113+
testImportExportEquivalence "$solfile"
114114
else
115115
# All other return codes will be treated as critical errors. The script will exit.
116116
echo -e "\nGot unexpected return code ${SPLITSOURCES_RC} from ${SPLITSOURCES}. Aborting."
117117
echo -e "\n${OUTPUT}\n"
118118

119-
cd $WORKINGDIR
119+
cd "$WORKINGDIR"
120120
# Delete temporary files
121-
rm -rf $FILETMP
121+
rm -rf "$FILETMP"
122122

123123
exit 1
124124
fi
125125

126-
cd $WORKINGDIR
126+
cd "$WORKINGDIR"
127127
# Delete temporary files
128-
rm -rf $FILETMP
128+
rm -rf "$FILETMP"
129129
done
130130

131131
echo ""

scripts/build_emscripten.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ else
3535
fi
3636

3737
# solbuildpackpusher/solidity-buildpack-deps:emscripten-4
38-
docker run -v $(pwd):/root/project -w /root/project \
38+
docker run -v "$(pwd):/root/project" -w /root/project \
3939
solbuildpackpusher/solidity-buildpack-deps@sha256:434719d8104cab47712dd1f56f255994d04eb65b802c0d382790071c1a0c074b \
40-
./scripts/ci/build_emscripten.sh $BUILD_DIR
40+
./scripts/ci/build_emscripten.sh "$BUILD_DIR"

scripts/bytecodecompare/storebytecode.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ TMPDIR=$(mktemp -d)
4646
git clone --depth 1 https://github.com/ethereum/solc-js.git solc-js
4747
( cd solc-js; npm install )
4848
cp "$REPO_ROOT/emscripten_build/libsolc/soljson.js" solc-js/
49-
cp ""$REPO_ROOT"/scripts/bytecodecompare/prepare_report.js" .
49+
cp "$REPO_ROOT/scripts/bytecodecompare/prepare_report.js" .
5050
echo "Running the compiler..."
5151
./prepare_report.js *.sol > report.txt
5252
echo "Finished running the compiler."

scripts/ci/build_emscripten.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ then
5959
echo -n "$CIRCLE_SHA1" >commit_hash.txt
6060
fi
6161

62-
mkdir -p $BUILD_DIR
63-
cd $BUILD_DIR
62+
mkdir -p "$BUILD_DIR"
63+
cd "$BUILD_DIR"
6464
emcmake cmake \
6565
-DCMAKE_BUILD_TYPE=Release \
6666
-DBoost_USE_STATIC_LIBS=1 \
@@ -75,8 +75,8 @@ sed -i -e 's/addFunction(func,sig){/addFunction(func,sig){sig=sig||"viiiii";/' l
7575

7676
cd ..
7777
mkdir -p upload
78-
cp $BUILD_DIR/libsolc/soljson.js upload/
79-
cp $BUILD_DIR/libsolc/soljson.js ./
78+
cp "$BUILD_DIR/libsolc/soljson.js" upload/
79+
cp "$BUILD_DIR/libsolc/soljson.js" ./
8080

8181
OUTPUT_SIZE=`ls -la soljson.js`
8282

scripts/common_cmdline.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ function compileFull()
3939
fi
4040
local args=$FULLARGS
4141
if [[ $1 = '-v' ]]; then
42-
if (echo $2 | grep -Po '(?<=0.4.)\d+' >/dev/null); then
43-
patch=$(echo $2 | grep -Po '(?<=0.4.)\d+')
42+
if (echo "$2" | grep -Po '(?<=0.4.)\d+' >/dev/null); then
43+
patch=$(echo "$2" | grep -Po '(?<=0.4.)\d+')
4444
if (( patch < 22 )); then
4545
args=$OLDARGS
4646
fi

scripts/deps-ppa/static_z3.sh

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ DISTRIBUTIONS="focal groovy"
3232
for distribution in $DISTRIBUTIONS
3333
do
3434
cd /tmp/
35-
rm -rf $distribution
36-
mkdir $distribution
37-
cd $distribution
35+
rm -rf "$distribution"
36+
mkdir "$distribution"
37+
cd "$distribution"
3838

3939
pparepo=cpp-build-deps
4040
ppafilesurl=https://launchpad.net/~ethereum/+archive/ubuntu/${pparepo}/+files
@@ -190,7 +190,7 @@ echo "3.0 (quilt)" > debian/source/format
190190
chmod +x debian/rules
191191

192192
versionsuffix=1ubuntu0~${distribution}
193-
EMAIL="$email" dch -v 1:${debversion}-${versionsuffix} "build of ${version}"
193+
EMAIL="$email" dch -v "1:${debversion}-${versionsuffix}" "build of ${version}"
194194

195195
# build source package
196196
# If packages is rejected because original source is already present, add
@@ -199,13 +199,13 @@ EMAIL="$email" dch -v 1:${debversion}-${versionsuffix} "build of ${version}"
199199
debuild -S -d -sa -us -uc
200200

201201
# prepare .changes file for Launchpad
202-
sed -i -e s/UNRELEASED/${distribution}/ -e s/urgency=medium/urgency=low/ ../*.changes
202+
sed -i -e "s/UNRELEASED/${distribution}/" -e s/urgency=medium/urgency=low/ ../*.changes
203203

204204
# check if ubuntu already has the source tarball
205205
(
206206
cd ..
207-
orig=${packagename}_${debversion}.orig.tar.gz
208-
orig_size=$(ls -l $orig | cut -d ' ' -f 5)
207+
orig="${packagename}_${debversion}.orig.tar.gz"
208+
orig_size=$(ls -l "$orig" | cut -d ' ' -f 5)
209209
orig_sha1=$(sha1sum $orig | cut -d ' ' -f 1)
210210
orig_sha256=$(sha256sum $orig | cut -d ' ' -f 1)
211211
orig_md5=$(md5sum $orig | cut -d ' ' -f 1)
@@ -218,15 +218,15 @@ then
218218
new_sha1=$(sha1sum $orig | cut -d ' ' -f 1)
219219
new_sha256=$(sha256sum $orig | cut -d ' ' -f 1)
220220
new_md5=$(md5sum $orig | cut -d ' ' -f 1)
221-
sed -i -e s,$orig_sha1,$new_sha1,g -e s,$orig_sha256,$new_sha256,g -e s,$orig_size,$new_size,g -e s,$orig_md5,$new_md5,g *.dsc
222-
sed -i -e s,$orig_sha1,$new_sha1,g -e s,$orig_sha256,$new_sha256,g -e s,$orig_size,$new_size,g -e s,$orig_md5,$new_md5,g *.changes
221+
sed -i -e "s,$orig_sha1,$new_sha1,g" -e "s,$orig_sha256,$new_sha256,g" -e "s,$orig_size,$new_size,g" -e "s,$orig_md5,$new_md5,g" *.dsc
222+
sed -i -e "s,$orig_sha1,$new_sha1,g" -e "s,$orig_sha256,$new_sha256,g" -e "s,$orig_size,$new_size,g" -e "s,$orig_md5,$new_md5,g" *.changes
223223
fi
224224
)
225225

226226
# sign the package
227-
debsign --re-sign -k ${keyid} ../${packagename}_${debversion}-${versionsuffix}_source.changes
227+
debsign --re-sign -k "${keyid}" "../${packagename}_${debversion}-${versionsuffix}_source.changes"
228228

229229
# upload
230-
dput ${pparepo} ../${packagename}_${debversion}-${versionsuffix}_source.changes
230+
dput "${pparepo}" "../${packagename}_${debversion}-${versionsuffix}_source.changes"
231231

232232
done

scripts/docker_deploy_manual.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ git clone --depth 2 https://github.com/ethereum/solidity.git -b "$branch"
2020
cd solidity
2121
commithash=$(git rev-parse --short=8 HEAD)
2222
echo -n "$commithash" > commit_hash.txt
23-
version=$($(dirname "$0")/get_version.sh)
23+
version=$("$(dirname "$0")/get_version.sh")
2424
if [ "$branch" = "release" -o "$branch" = v"$version" ]
2525
then
2626
echo -n > prerelease.txt
@@ -40,7 +40,7 @@ tmp_container=$(docker create "$image":build sh)
4040

4141
# Alpine image
4242
mkdir -p upload
43-
docker cp ${tmp_container}:/usr/bin/solc upload/solc-static-linux
43+
docker cp "${tmp_container}":/usr/bin/solc upload/solc-static-linux
4444
docker build -t "$image":build-alpine -f scripts/Dockerfile_alpine .
4545

4646
if [ "$branch" = "develop" ]

scripts/docs_version_pragma_check.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ set -e
2727

2828
## GLOBAL VARIABLES
2929

30-
REPO_ROOT=$(cd $(dirname "$0")/.. && pwd)
30+
REPO_ROOT=$(cd "$(dirname "$0")/.." && pwd)
3131
SOLIDITY_BUILD_DIR=${SOLIDITY_BUILD_DIR:-${REPO_ROOT}/build}
3232
source "${REPO_ROOT}/scripts/common.sh"
3333
source "${REPO_ROOT}/scripts/common_cmdline.sh"
@@ -41,13 +41,13 @@ function versionGreater()
4141
ver1=( ${v1//./ } )
4242
ver2=( ${v2//./ } )
4343

44-
if (( ${ver1[0]} > ${ver2[0]} ))
44+
if (( "${ver1[0]}" > "${ver2[0]}" ))
4545
then
4646
return 0
47-
elif (( ${ver1[0]} == ${ver2[0]} )) && (( ${ver1[1]} > ${ver2[1]} ))
47+
elif (( "${ver1[0]}" == "${ver2[0]}" )) && (( "${ver1[1]}" > "${ver2[1]}" ))
4848
then
4949
return 0
50-
elif (( ${ver1[0]} == ${ver2[0]} )) && (( ${ver1[1]} == ${ver2[1]} )) && (( ${ver1[2]} > ${ver2[2]} ))
50+
elif (( "${ver1[0]}" == "${ver2[0]}" )) && (( "${ver1[1]}" == "${ver2[1]}" )) && (( "${ver1[2]}" > "${ver2[2]}" ))
5151
then
5252
return 0
5353
fi
@@ -75,7 +75,7 @@ function getAllAvailableVersions()
7575
do
7676
if versionGreater "$listed" "0.4.10"
7777
then
78-
allVersions+=( $listed )
78+
allVersions+=( "$listed" )
7979
fi
8080
done
8181
}
@@ -157,7 +157,7 @@ SOLTMPDIR=$(mktemp -d)
157157
# ignore warnings in this case
158158
opts="$opts -o"
159159

160-
findMinimalVersion $f
160+
findMinimalVersion "$f"
161161
if [[ "$version" == "" ]]
162162
then
163163
continue
@@ -175,9 +175,9 @@ SOLTMPDIR=$(mktemp -d)
175175
if [[ ! -f "$solc_bin" ]]
176176
then
177177
echo "Downloading release from github..."
178-
if wget -q https://github.com/ethereum/solidity/releases/download/v$version/solc-static-linux >/dev/null
178+
if wget -q "https://github.com/ethereum/solidity/releases/download/v$version/solc-static-linux" >/dev/null
179179
then
180-
mv solc-static-linux $solc_bin
180+
mv solc-static-linux "$solc_bin"
181181
else
182182
printError "No release $version was found on github!"
183183
continue

0 commit comments

Comments
 (0)