Merge pull request #10584 from ethereum/fix-minor-bugs-in-shell-scripts

Fix minor bugs in shell scripts
This commit is contained in:
chriseth 2020-12-14 10:01:48 +01:00 committed by GitHub
commit 12f31c49ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 15 additions and 15 deletions

View File

@ -36,7 +36,6 @@ set -e
OPTIMIZE=${OPTIMIZE:-"0"}
EVM=${EVM:-"invalid"}
WORKDIR=${CIRCLE_WORKING_DIRECTORY:-.}
REPODIR="$(realpath $(dirname $0)/..)"
source "${REPODIR}/scripts/common.sh"

View File

@ -80,6 +80,6 @@ done
if (($STEP != $STEPS + 1))
then
echo "Step counter not properly adjusted!" >2
echo "Step counter not properly adjusted!" >&2
exit 1
fi

View File

@ -98,7 +98,7 @@ do
NSOURCES=$((NSOURCES - 1))
for i in $OUTPUT;
do
testImportExportEquivalence $i $OUTPUT
testImportExportEquivalence "$i" "$OUTPUT"
NSOURCES=$((NSOURCES + 1))
done
elif [ ${SPLITSOURCES_RC} == 1 ]

View File

@ -49,7 +49,6 @@ function compileFull()
fi
local files="$*"
local output
local stderr_path=$(mktemp)

View File

@ -28,4 +28,4 @@
set -e
grep -oP "PROJECT_VERSION \"?\K[0-9.]+(?=\")"? $(dirname "$0")/../CMakeLists.txt
grep -oP "PROJECT_VERSION \"?\K[0-9.]+(?=\")?" $(dirname "$0")/../CMakeLists.txt

View File

@ -27,7 +27,6 @@ if test -f $BIN/cmake && ($BIN/cmake --version | grep -q "$VERSION"); then
else
FILE=cmake-$VERSION-$OS-x86_64.tar.gz
URL=https://cmake.org/files/v$VERSION_MAJOR.$VERSION_MINOR/$FILE
ERROR=0
TMPFILE=$(mktemp --tmpdir cmake-$VERSION-$OS-x86_64.XXXXXXXX.tar.gz)
echo "Downloading CMake ($URL)..."
wget "$URL" -O "$TMPFILE" -nv

View File

@ -113,7 +113,6 @@ wget -O ./solc/deps/downloads/jsoncpp-1.9.3.tar.gz https://github.com/open-sourc
cd solc
version=$($(dirname "$0")/get_version.sh)
commithash=$(git rev-parse --short=8 HEAD)
committimestamp=$(git show --format=%ci HEAD | head -n 1)
commitdate=$(git show --format=%ci HEAD | head -n 1 | cut - -b1-10 | sed -e 's/-0?/./' | sed -e 's/-0?/./')
echo "$commithash" > commit_hash.txt

View File

@ -109,9 +109,9 @@ do
then
if [ -n "$optimize" ]
then
log=--logger=JUNIT,error,$log_directory/opt_$vm.xml $testargs
log=--logger=JUNIT,error,$log_directory/opt_$vm.xml
else
log=--logger=JUNIT,error,$log_directory/noopt_$vm.xml $testargs_no_opt
log=--logger=JUNIT,error,$log_directory/noopt_$vm.xml
fi
fi

View File

@ -1,7 +1,8 @@
#!/bin/bash
TAG="$1"
SOLJSON_JS="$2"
# If we ever want to patch the binaries e.g. for compatibility with older solc-js versions,
# we can do that here.
#
# This script gets the following parameters:
# - TAG
# - SOLJSON_JS

View File

@ -206,7 +206,7 @@ function test_solc_assembly_output()
local expected_object="object \"object\" { code "${expected}" }"
output=$(echo "${input}" | "$SOLC" - ${solc_args} 2>/dev/null)
empty=$(echo $output | sed -ne '/'"${expected_object}"'/p')
empty=$(echo "$output" | tr '\n' ' ' | tr -s ' ' | sed -ne "/${expected_object}/p")
if [ -z "$empty" ]
then
printError "Incorrect assembly output. Expected: "
@ -436,15 +436,18 @@ SOLTMPDIR=$(mktemp -d)
# The contract should be compiled
if [[ "$result" != 0 ]]
then
printError "Failed to compile a simple contract from standard input"
exit 1
fi
# This should not fail
set +e
output=$(echo '' | "$SOLC" --ast - 2>/dev/null)
output=$(echo '' | "$SOLC" --ast-json - 2>/dev/null)
result=$?
set -e
if [[ $? != 0 ]]
if [[ $result != 0 ]]
then
printError "Incorrect response to --ast-json option with empty stdin"
exit 1
fi
)