From ef381e54b124a7bb71dcb883fdc999f3bd37d4ed Mon Sep 17 00:00:00 2001 From: Androbin Date: Thu, 14 Dec 2017 07:24:27 -0800 Subject: Shell code cleanup - Argument mixes string and array. Use * or separate argument. - Quote the grep pattern so the shell won't interpret it. - Use "${var:?}" to ensure this never expands to /* . - > is for string comparisons. Use -gt instead. - Quote the parameter to -name so the shell won't interpret it. Closes #4163. PiperOrigin-RevId: 179042046 --- scripts/bootstrap/buildenv.sh | 2 +- scripts/bootstrap/compile.sh | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'scripts/bootstrap') diff --git a/scripts/bootstrap/buildenv.sh b/scripts/bootstrap/buildenv.sh index 5c5061b45d..8dfb6fe917 100755 --- a/scripts/bootstrap/buildenv.sh +++ b/scripts/bootstrap/buildenv.sh @@ -38,7 +38,7 @@ function fail() { exitCode=1 fi echo >&2 - echo "ERROR: $@" >&2 + echo "ERROR: $*" >&2 exit $exitCode } diff --git a/scripts/bootstrap/compile.sh b/scripts/bootstrap/compile.sh index e817b1908e..c7b26ccc72 100755 --- a/scripts/bootstrap/compile.sh +++ b/scripts/bootstrap/compile.sh @@ -17,11 +17,11 @@ # Script for building bazel from scratch without bazel PROTO_FILES=$(ls src/main/protobuf/*.proto src/main/java/com/google/devtools/build/lib/buildeventstream/proto/*.proto) -LIBRARY_JARS=$(find third_party -name '*.jar' | grep -Fv /javac-9-dev-r3297-4.jar | grep -Fv /javac-9-dev-4023-3.jar | grep -Fv /javac7.jar | grep -Fv JavaBuilder | grep -Fv third_party/guava | grep -Fv third_party/guava | grep -ve third_party/grpc/grpc.*jar | tr "\n" " ") +LIBRARY_JARS=$(find third_party -name '*.jar' | grep -Fv /javac-9-dev-r3297-4.jar | grep -Fv /javac-9-dev-4023-3.jar | grep -Fv /javac7.jar | grep -Fv JavaBuilder | grep -Fv third_party/guava | grep -Fv third_party/guava | grep -ve 'third_party/grpc/grpc.*jar' | tr "\n" " ") GRPC_JAVA_VERSION=1.7.0 -GRPC_LIBRARY_JARS=$(find third_party/grpc -name '*.jar' | grep -e .*${GRPC_JAVA_VERSION}.*jar | tr "\n" " ") +GRPC_LIBRARY_JARS=$(find third_party/grpc -name '*.jar' | grep -e ".*${GRPC_JAVA_VERSION}.*jar" | tr "\n" " ") GUAVA_VERSION=23.1 -GUAVA_JARS=$(find third_party/guava -name '*.jar' | grep -e .*${GUAVA_VERSION}.*jar | tr "\n" " ") +GUAVA_JARS=$(find third_party/guava -name '*.jar' | grep -e ".*${GUAVA_VERSION}.*jar" | tr "\n" " ") LIBRARY_JARS="${LIBRARY_JARS} ${GRPC_LIBRARY_JARS} ${GUAVA_JARS}" # tl;dr - error_prone_core contains a copy of an older version of guava, so we -- cgit v1.2.3