scripts: add missing quotes, and minor linting issues

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2021-07-20 12:06:02 +02:00
parent 0cb656860f
commit dba0ef4eb5
14 changed files with 58 additions and 53 deletions

View File

@@ -45,4 +45,4 @@ case "${SELINUX}" in
;;
esac
echo SELinux is $(getenforce)
echo SELinux is "$(getenforce)"

View File

@@ -28,7 +28,7 @@ CNI_CONFIG_DIR=${DESTDIR}/etc/cni/net.d
TMPROOT=$(mktemp -d)
git clone https://github.com/containernetworking/plugins.git "${TMPROOT}"/plugins
pushd "${TMPROOT}"/plugins
git checkout $CNI_COMMIT
git checkout "$CNI_COMMIT"
./build_linux.sh
mkdir -p $CNI_DIR
cp -r ./bin $CNI_DIR

View File

@@ -37,7 +37,7 @@ split_ip() {
local -r varname="$1"
local -r ip="$2"
for i in {0..3}; do
eval "$varname"[$i]=$( echo "$ip" | cut -d '.' -f $((i + 1)) )
eval "$varname"[$i]="$( echo "$ip" | cut -d '.' -f $((i + 1)) )"
done
}

View File

@@ -26,16 +26,17 @@ cd "$GOPATH"
go get -u github.com/onsi/ginkgo/ginkgo
: "${CRITEST_COMMIT:=$(cat "${script_dir}/critools-version")}"
: "${DESTDIR:=""}"
TMPROOT=$(mktemp -d)
git clone https://github.com/kubernetes-sigs/cri-tools.git "${TMPROOT}"/cri-tools
git clone https://github.com/kubernetes-sigs/cri-tools.git "${TMPROOT}/cri-tools"
pushd "${TMPROOT}"/cri-tools
git checkout "$CRITEST_COMMIT"
make
make install -e DESTDIR=${DESTDIR:=''} BINDIR=/usr/local/bin
make install -e DESTDIR="${DESTDIR}" BINDIR=/usr/local/bin
mkdir -p ${DESTDIR:=''}/etc/
cat << EOF | tee ${DESTDIR:=''}/etc/crictl.yaml
mkdir -p "${DESTDIR}/etc/"
cat << EOF | tee "${DESTDIR}/etc/crictl.yaml"
runtime-endpoint: unix:///run/containerd/containerd.sock
EOF

View File

@@ -28,27 +28,27 @@ PROTOBUF_DIR=$(mktemp -d)
case $GOARCH in
arm64)
wget -O $PROTOBUF_DIR/protobuf "https://github.com/protocolbuffers/protobuf/releases/download/v$PROTOBUF_VERSION/protoc-$PROTOBUF_VERSION-linux-aarch64.zip"
unzip $PROTOBUF_DIR/protobuf -d /usr/local
wget -O "$PROTOBUF_DIR/protobuf" "https://github.com/protocolbuffers/protobuf/releases/download/v$PROTOBUF_VERSION/protoc-$PROTOBUF_VERSION-linux-aarch64.zip"
unzip "$PROTOBUF_DIR/protobuf" -d /usr/local
;;
amd64|386)
if [ "$GOOS" = windows ]; then
wget -O $PROTOBUF_DIR/protobuf "https://github.com/protocolbuffers/protobuf/releases/download/v$PROTOBUF_VERSION/protoc-$PROTOBUF_VERSION-win32.zip"
wget -O "$PROTOBUF_DIR/protobuf" "https://github.com/protocolbuffers/protobuf/releases/download/v$PROTOBUF_VERSION/protoc-$PROTOBUF_VERSION-win32.zip"
elif [ "$GOOS" = linux ]; then
wget -O $PROTOBUF_DIR/protobuf "https://github.com/protocolbuffers/protobuf/releases/download/v$PROTOBUF_VERSION/protoc-$PROTOBUF_VERSION-linux-x86_64.zip"
wget -O "$PROTOBUF_DIR/protobuf" "https://github.com/protocolbuffers/protobuf/releases/download/v$PROTOBUF_VERSION/protoc-$PROTOBUF_VERSION-linux-x86_64.zip"
fi
unzip $PROTOBUF_DIR/protobuf -d /usr/local
unzip "$PROTOBUF_DIR/protobuf" -d /usr/local
;;
ppc64le)
wget -O $PROTOBUF_DIR/protobuf "https://github.com/protocolbuffers/protobuf/releases/download/v$PROTOBUF_VERSION/protoc-$PROTOBUF_VERSION-linux-ppcle_64.zip"
unzip $PROTOBUF_DIR/protobuf -d /usr/local
wget -O "$PROTOBUF_DIR/protobuf" "https://github.com/protocolbuffers/protobuf/releases/download/v$PROTOBUF_VERSION/protoc-$PROTOBUF_VERSION-linux-ppcle_64.zip"
unzip "$PROTOBUF_DIR/protobuf" -d /usr/local
;;
*)
wget -O $PROTOBUF_DIR/protobuf "https://github.com/protocolbuffers/protobuf/releases/download/v$PROTOBUF_VERSION/protobuf-cpp-$PROTOBUF_VERSION.zip"
unzip $PROTOBUF_DIR/protobuf -d /usr/src/protobuf
cd /usr/src/protobuf/protobuf-$PROTOBUF_VERSION
wget -O "$PROTOBUF_DIR/protobuf" "https://github.com/protocolbuffers/protobuf/releases/download/v$PROTOBUF_VERSION/protobuf-cpp-$PROTOBUF_VERSION.zip"
unzip "$PROTOBUF_DIR/protobuf" -d /usr/src/protobuf
cd "/usr/src/protobuf/protobuf-$PROTOBUF_VERSION"
./autogen.sh
./configure --disable-shared
make
@@ -57,4 +57,4 @@ ppc64le)
ldconfig
;;
esac
rm -rf $PROTOBUF_DIR
rm -rf "$PROTOBUF_DIR"

View File

@@ -23,7 +23,8 @@ set -eu -o pipefail
set -x
export SECCOMP_VERSION=2.5.1
export SECCOMP_PATH=$(mktemp -d)
SECCOMP_PATH=$(mktemp -d)
export SECCOMP_PATH
curl -fsSL "https://github.com/seccomp/libseccomp/releases/download/v${SECCOMP_VERSION}/libseccomp-${SECCOMP_VERSION}.tar.gz" | tar -xzC "$SECCOMP_PATH" --strip-components=1
(
cd "$SECCOMP_PATH"