mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Disable shellcheck in the remaining situations where it's either wrong or the problem is not worth fixing
This commit is contained in:
parent
008d648af3
commit
8e44b59251
@ -48,6 +48,7 @@ TMPDIR=$(mktemp -d)
|
|||||||
cp "$REPO_ROOT/emscripten_build/libsolc/soljson.js" solc-js/
|
cp "$REPO_ROOT/emscripten_build/libsolc/soljson.js" solc-js/
|
||||||
cp "$REPO_ROOT/scripts/bytecodecompare/prepare_report.js" .
|
cp "$REPO_ROOT/scripts/bytecodecompare/prepare_report.js" .
|
||||||
echo "Running the compiler..."
|
echo "Running the compiler..."
|
||||||
|
# shellcheck disable=SC2035
|
||||||
./prepare_report.js *.sol > report.txt
|
./prepare_report.js *.sol > report.txt
|
||||||
echo "Finished running the compiler."
|
echo "Finished running the compiler."
|
||||||
else
|
else
|
||||||
|
@ -40,7 +40,9 @@ function versionGreater()
|
|||||||
{
|
{
|
||||||
v1=$1
|
v1=$1
|
||||||
v2=$2
|
v2=$2
|
||||||
|
# shellcheck disable=SC2206
|
||||||
ver1=( ${v1//./ } )
|
ver1=( ${v1//./ } )
|
||||||
|
# shellcheck disable=SC2206
|
||||||
ver2=( ${v2//./ } )
|
ver2=( ${v2//./ } )
|
||||||
|
|
||||||
if (( "${ver1[0]}" > "${ver2[0]}" ))
|
if (( "${ver1[0]}" > "${ver2[0]}" ))
|
||||||
|
@ -175,6 +175,7 @@ case $(uname -s) in
|
|||||||
|
|
||||||
Debian*|Raspbian)
|
Debian*|Raspbian)
|
||||||
#Debian
|
#Debian
|
||||||
|
# shellcheck disable=SC1091
|
||||||
. /etc/os-release
|
. /etc/os-release
|
||||||
install_z3=""
|
install_z3=""
|
||||||
case $VERSION_ID in
|
case $VERSION_ID in
|
||||||
@ -354,7 +355,10 @@ case $(uname -s) in
|
|||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
CentOS*)
|
CentOS*)
|
||||||
echo "Attention: CentOS 7 is currently not supported!";
|
echo "Attention: CentOS 7 is currently not supported!";
|
||||||
|
# FIXME: read -p and [[ ]] are bash features but our shebang says we're using sh
|
||||||
|
# shellcheck disable=SC2039
|
||||||
read -p "This script will heavily modify your system in order to allow for compilation of Solidity. Are you sure? [Y/N]" -n 1 -r
|
read -p "This script will heavily modify your system in order to allow for compilation of Solidity. Are you sure? [Y/N]" -n 1 -r
|
||||||
|
# shellcheck disable=SC2039
|
||||||
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
||||||
# Make Sure we have the EPEL repos
|
# Make Sure we have the EPEL repos
|
||||||
sudo yum -y install epel-release
|
sudo yum -y install epel-release
|
||||||
|
@ -190,6 +190,7 @@ echo "Extract bytecode comparison scripts from v0.6.1..."
|
|||||||
cd /root/project
|
cd /root/project
|
||||||
git checkout v0.6.1 --quiet
|
git checkout v0.6.1 --quiet
|
||||||
cp scripts/bytecodecompare/storebytecode.sh /tmp
|
cp scripts/bytecodecompare/storebytecode.sh /tmp
|
||||||
|
# shellcheck disable=SC2016
|
||||||
sed -i -e 's/rm -rf "\$TMPDIR"/cp "\$TMPDIR"\/report.txt \/tmp\/report.txt ; rm -rf "\$TMPDIR"/' /tmp/storebytecode.sh
|
sed -i -e 's/rm -rf "\$TMPDIR"/cp "\$TMPDIR"\/report.txt \/tmp\/report.txt ; rm -rf "\$TMPDIR"/' /tmp/storebytecode.sh
|
||||||
sed -i -e 's/REPO_ROOT=.*/REPO_ROOT=\/src/' /tmp/storebytecode.sh
|
sed -i -e 's/REPO_ROOT=.*/REPO_ROOT=\/src/' /tmp/storebytecode.sh
|
||||||
export SOLC_EMSCRIPTEN="On"
|
export SOLC_EMSCRIPTEN="On"
|
||||||
|
@ -126,6 +126,7 @@ function test_solc_behaviour()
|
|||||||
local stdout_path; stdout_path=$(mktemp)
|
local stdout_path; stdout_path=$(mktemp)
|
||||||
local stderr_path; stderr_path=$(mktemp)
|
local stderr_path; stderr_path=$(mktemp)
|
||||||
|
|
||||||
|
# shellcheck disable=SC2064
|
||||||
trap "rm -f $stdout_path $stderr_path" EXIT
|
trap "rm -f $stdout_path $stderr_path" EXIT
|
||||||
|
|
||||||
if [[ "$exit_code_expected" = "" ]]; then exit_code_expected="0"; fi
|
if [[ "$exit_code_expected" = "" ]]; then exit_code_expected="0"; fi
|
||||||
@ -146,10 +147,13 @@ function test_solc_behaviour()
|
|||||||
|
|
||||||
# Remove bytecode (but not linker references).
|
# Remove bytecode (but not linker references).
|
||||||
sed -i.bak -E -e 's/(\"object\":\")[0-9a-f]+([^"]*\")/\1<BYTECODE REMOVED>\2/g' "$stdout_path"
|
sed -i.bak -E -e 's/(\"object\":\")[0-9a-f]+([^"]*\")/\1<BYTECODE REMOVED>\2/g' "$stdout_path"
|
||||||
|
# shellcheck disable=SC2016
|
||||||
sed -i.bak -E -e 's/(\"object\":\"[^"]+\$__)[0-9a-f]+(\")/\1<BYTECODE REMOVED>\2/g' "$stdout_path"
|
sed -i.bak -E -e 's/(\"object\":\"[^"]+\$__)[0-9a-f]+(\")/\1<BYTECODE REMOVED>\2/g' "$stdout_path"
|
||||||
|
# shellcheck disable=SC2016
|
||||||
sed -i.bak -E -e 's/([0-9a-f]{34}\$__)[0-9a-f]+(__\$[0-9a-f]{17})/\1<BYTECODE REMOVED>\2/g' "$stdout_path"
|
sed -i.bak -E -e 's/([0-9a-f]{34}\$__)[0-9a-f]+(__\$[0-9a-f]{17})/\1<BYTECODE REMOVED>\2/g' "$stdout_path"
|
||||||
|
|
||||||
# Replace escaped newlines by actual newlines for readability
|
# Replace escaped newlines by actual newlines for readability
|
||||||
|
# shellcheck disable=SC1003
|
||||||
sed -i.bak -E -e 's/\\n/\'$'\n/g' "$stdout_path"
|
sed -i.bak -E -e 's/\\n/\'$'\n/g' "$stdout_path"
|
||||||
rm "$stdout_path.bak"
|
rm "$stdout_path.bak"
|
||||||
else
|
else
|
||||||
@ -166,7 +170,9 @@ function test_solc_behaviour()
|
|||||||
# 64697066735822 = hex encoding of 0x64 'i' 'p' 'f' 's' 0x58 0x22
|
# 64697066735822 = hex encoding of 0x64 'i' 'p' 'f' 's' 0x58 0x22
|
||||||
# 64736f6c63 = hex encoding of 0x64 's' 'o' 'l' 'c'
|
# 64736f6c63 = hex encoding of 0x64 's' 'o' 'l' 'c'
|
||||||
sed -i.bak -E -e 's/[0-9a-f]*64697066735822[0-9a-f]+64736f6c63[0-9a-f]+/<BYTECODE REMOVED>/g' "$stdout_path"
|
sed -i.bak -E -e 's/[0-9a-f]*64697066735822[0-9a-f]+64736f6c63[0-9a-f]+/<BYTECODE REMOVED>/g' "$stdout_path"
|
||||||
|
# shellcheck disable=SC2016
|
||||||
sed -i.bak -E -e 's/([0-9a-f]{17}\$__)[0-9a-f]+(__\$[0-9a-f]{17})/\1<BYTECODE REMOVED>\2/g' "$stdout_path"
|
sed -i.bak -E -e 's/([0-9a-f]{17}\$__)[0-9a-f]+(__\$[0-9a-f]{17})/\1<BYTECODE REMOVED>\2/g' "$stdout_path"
|
||||||
|
# shellcheck disable=SC2016
|
||||||
sed -i.bak -E -e 's/[0-9a-f]+((__\$[0-9a-f]{34}\$__)*<BYTECODE REMOVED>)/<BYTECODE REMOVED>\1/g' "$stdout_path"
|
sed -i.bak -E -e 's/[0-9a-f]+((__\$[0-9a-f]{34}\$__)*<BYTECODE REMOVED>)/<BYTECODE REMOVED>\1/g' "$stdout_path"
|
||||||
|
|
||||||
# Remove trailing empty lines. Needs a line break to make OSX sed happy.
|
# Remove trailing empty lines. Needs a line break to make OSX sed happy.
|
||||||
|
Loading…
Reference in New Issue
Block a user