Fix inconsistent shell script comparison operator ==

In package-airgap and provision/vagrant, replace == with = which is
used in all other script string comparisons in this repository to keep
things consistent.

Change-Id: I2f59e9a8d1d2fc2984ed3952fd4794f1028b6f66
Signed-off-by: Joakim Roubert <joakimr@axis.com>
pull/1495/head
Joakim Roubert 2020-03-04 16:25:40 +01:00
parent ceff3f58fb
commit 0a54d46c5b
2 changed files with 12 additions and 12 deletions

View File

@ -8,10 +8,10 @@ cd $(dirname $0)/..
images=$(cat scripts/airgap/image-list.txt) images=$(cat scripts/airgap/image-list.txt)
xargs -n1 docker pull <<< "${images}" xargs -n1 docker pull <<< "${images}"
# Add exception for nginx # Add exception for nginx
NGINX_IMAGE_VERSION="0.30.0" NGINX_IMAGE_VERSION='0.30.0'
NGINX_IMAGE="quay.io/kubernetes-ingress-controller/nginx-ingress-controller" NGINX_IMAGE='quay.io/kubernetes-ingress-controller/nginx-ingress-controller'
ADD_ARCH="" ADD_ARCH=''
if [ "$ARCH" == "arm" ] || [ "$ARCH" == "arm64" ]; then if [ "$ARCH" = 'arm' ] || [ "$ARCH" = 'arm64' ]; then
ADD_ARCH="-$ARCH" ADD_ARCH="-$ARCH"
fi fi
docker pull "$NGINX_IMAGE$ADD_ARCH:$NGINX_IMAGE_VERSION" docker pull "$NGINX_IMAGE$ADD_ARCH:$NGINX_IMAGE_VERSION"

View File

@ -4,12 +4,12 @@ set -ve
PROVISION="scripts/provision/$BOX/vagrant" PROVISION="scripts/provision/$BOX/vagrant"
if [ ! -f /etc/vagrant_box_build_time ]; then if [ ! -f /etc/vagrant_box_build_time ]; then
echo "This script should only be called during vagrant provisioning" echo 'This script should only be called during vagrant provisioning'
exit 1 exit 1
fi fi
if [[ $HOME == /go/* ]]; then if [[ $HOME = /go/* ]]; then
echo "Must not launch vagrant from /go/" echo 'Must not launch vagrant from /go/'
exit 1 exit 1
fi fi
cd cd
@ -31,9 +31,9 @@ fi
cat <<EOF >/etc/profile.d/env.sh cat <<EOF >/etc/profile.d/env.sh
export ARCH=amd64 export ARCH=amd64
export GO111MODULE=off export GO111MODULE=off
export GOPATH="$GOPATH" export GOPATH=$GOPATH
export PATH=/usr/local/bin:$PATH:/usr/local/go/bin:$GOPATH/bin export PATH=/usr/local/bin:$PATH:/usr/local/go/bin:$GOPATH/bin
export HOME="$HOME" && cd export HOME=$HOME && cd
EOF EOF
. /etc/profile.d/env.sh . /etc/profile.d/env.sh
@ -72,7 +72,7 @@ EOF
download_go() { download_go() {
goversion=$(grep "^FROM " Dockerfile.dapper | sed -e 's/^FROM golang:\(.*\)-.*/\1/') goversion=$(grep "^FROM " Dockerfile.dapper | sed -e 's/^FROM golang:\(.*\)-.*/\1/')
if [ -z "$goversion" ]; then if [ -z "$goversion" ]; then
echo "Cannot find version of go to fetch" echo 'Cannot find version of go to fetch'
return 1 return 1
fi fi
echo "Installing go $goversion" echo "Installing go $goversion"
@ -84,7 +84,7 @@ download_go() {
download_dqlite() { download_dqlite() {
dqliteURL="https://github.com/$(grep dqlite-build Dockerfile.dapper | sed -e 's/^.*--from=\([^ ]*\).*$/\1/' -e 's|:|/releases/download/|')/dqlite-$ARCH.tgz" dqliteURL="https://github.com/$(grep dqlite-build Dockerfile.dapper | sed -e 's/^.*--from=\([^ ]*\).*$/\1/' -e 's|:|/releases/download/|')/dqlite-$ARCH.tgz"
if [ -z "$dqliteURL" ]; then if [ -z "$dqliteURL" ]; then
echo "Cannot find dqlite URL to fetch" echo 'Cannot find dqlite URL to fetch'
return 1 return 1
fi fi
mkdir -p /usr/src/ mkdir -p /usr/src/
@ -94,7 +94,7 @@ download_dqlite() {
# --- Run vagrant provision script if available # --- Run vagrant provision script if available
if [ ! -f "${PROVISION}" ]; then if [ ! -f "${PROVISION}" ]; then
echo 'WARNING: Unable to execute provision script "${PROVISION}"' echo "WARNING: Unable to execute provision script \"${PROVISION}\""
exit exit
fi fi
echo "running '${PROVISION}'..." && \ echo "running '${PROVISION}'..." && \