aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/distrib
diff options
context:
space:
mode:
authorGravatar Mehrdad Afshari <mmx@google.com>2018-02-07 13:36:40 -0800
committerGravatar Mehrdad Afshari <mmx@google.com>2018-02-07 13:48:14 -0800
commit0a400c6c0a97eb3356627d8ccdace4ce84e85299 (patch)
treeb256b36e8bf1b698f30ab6101a4ed70436dd59a7 /test/distrib
parent6c39c9ecd4f75e6586547c4941de7a9fba6711c7 (diff)
Fix python/run_distrib_test.sh to pass shellcheck
Diffstat (limited to 'test/distrib')
-rwxr-xr-xtest/distrib/python/run_distrib_test.sh30
1 files changed, 16 insertions, 14 deletions
diff --git a/test/distrib/python/run_distrib_test.sh b/test/distrib/python/run_distrib_test.sh
index 02654be467..a855ae3b61 100755
--- a/test/distrib/python/run_distrib_test.sh
+++ b/test/distrib/python/run_distrib_test.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
# Copyright 2015 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,23 +15,25 @@
set -ex
-cd $(dirname $0)
+cd "$(dirname "$0")"
+
+shopt -s nullglob
# Pick up the source dist archive whatever its version is
-SDIST_ARCHIVES=$EXTERNAL_GIT_ROOT/input_artifacts/grpcio-*.tar.gz
-BDIST_ARCHIVES=$EXTERNAL_GIT_ROOT/input_artifacts/grpcio-*.whl
-TOOLS_SDIST_ARCHIVES=$EXTERNAL_GIT_ROOT/input_artifacts/grpcio_tools-*.tar.gz
-TOOLS_BDIST_ARCHIVES=$EXTERNAL_GIT_ROOT/input_artifacts/grpcio_tools-*.whl
+SDIST_ARCHIVES=("$EXTERNAL_GIT_ROOT"/input_artifacts/grpcio-*.tar.gz)
+BDIST_ARCHIVES=("$EXTERNAL_GIT_ROOT"/input_artifacts/grpcio-*.whl)
+TOOLS_SDIST_ARCHIVES=("$EXTERNAL_GIT_ROOT"/input_artifacts/grpcio_tools-*.tar.gz)
+TOOLS_BDIST_ARCHIVES=("$EXTERNAL_GIT_ROOT"/input_artifacts/grpcio_tools-*.whl)
function make_virtualenv() {
- virtualenv $1
- $1/bin/python -m pip install --upgrade six pip
- $1/bin/python -m pip install cython
+ virtualenv "$1"
+ "$1/bin/python" -m pip install --upgrade six pip
+ "$1/bin/python" -m pip install cython
}
function at_least_one_installs() {
for file in "$@"; do
- if python -m pip install $file; then
+ if python -m pip install "$file"; then
return 0
fi
done
@@ -45,11 +47,11 @@ make_virtualenv sdist_test
# Install our distributions in order of dependencies
#
-(source bdist_test/bin/activate && at_least_one_installs ${BDIST_ARCHIVES})
-(source bdist_test/bin/activate && at_least_one_installs ${TOOLS_BDIST_ARCHIVES})
+(source bdist_test/bin/activate && at_least_one_installs "${BDIST_ARCHIVES[@]}")
+(source bdist_test/bin/activate && at_least_one_installs "${TOOLS_BDIST_ARCHIVES[@]}")
-(source sdist_test/bin/activate && at_least_one_installs ${SDIST_ARCHIVES})
-(source sdist_test/bin/activate && at_least_one_installs ${TOOLS_SDIST_ARCHIVES})
+(source sdist_test/bin/activate && at_least_one_installs "${SDIST_ARCHIVES[@]}")
+(source sdist_test/bin/activate && at_least_one_installs "${TOOLS_SDIST_ARCHIVES[@]}")
#
# Test our distributions