From 9fac204a9c66e41b0932a340b6b6b4faa5873af0 Mon Sep 17 00:00:00 2001 From: Tim Hockin Date: Fri, 21 Jun 2024 08:46:00 -0700 Subject: [PATCH 1/2] Revert "consistently use bash shebang for shell scripts" This reverts commit 2c0d32b603d2b786eb6210a1c6f25a73662bbb77. --- build/build.sh | 2 +- build/test.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/build.sh b/build/build.sh index 8e5a939c4..0aec5c8fc 100755 --- a/build/build.sh +++ b/build/build.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # # Copyright 2016 The Kubernetes Authors. # diff --git a/build/test.sh b/build/test.sh index 42a302fe0..72487a32e 100755 --- a/build/test.sh +++ b/build/test.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # # Copyright 2016 The Kubernetes Authors. # From 8ed71953845fd4b3fc519f6e47226ef01292ef37 Mon Sep 17 00:00:00 2001 From: Tim Hockin Date: Fri, 21 Jun 2024 08:59:01 -0700 Subject: [PATCH 2/2] Fix build scripts to be strict sh --- build/build.sh | 3 +-- build/test.sh | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/build/build.sh b/build/build.sh index 0aec5c8fc..9a97034a9 100755 --- a/build/build.sh +++ b/build/build.sh @@ -16,7 +16,6 @@ set -o errexit set -o nounset -set -o pipefail if [ -z "${ARCH:-}" ]; then echo "ARCH must be set" @@ -35,7 +34,7 @@ export CGO_ENABLED=0 export GOARCH="${ARCH}" export GOOS="${OS}" -if [[ "${BUILD_DEBUG:-}" == 1 ]]; then +if [ "${BUILD_DEBUG:-}" -eq 1 ]; then # Debugging - disable optimizations and inlining gogcflags="all=-N -l" goasmflags="" diff --git a/build/test.sh b/build/test.sh index 72487a32e..51c6b0927 100755 --- a/build/test.sh +++ b/build/test.sh @@ -16,7 +16,6 @@ set -o errexit set -o nounset -set -o pipefail export CGO_ENABLED=0 export GOFLAGS="-mod=vendor" @@ -25,7 +24,7 @@ echo "Running tests:" go test -installsuffix "static" "$@" echo -echo -n "Checking gofmt: " +echo "Checking gofmt: " ERRS="$(go fmt "$@")" if [ -n "${ERRS}" ]; then echo "FAIL - the following files need to be gofmt'ed:" @@ -38,7 +37,7 @@ fi echo "PASS" echo -echo -n "Checking go vet: " +echo "Checking go vet: " ERRS="$(go vet "$@" 2>&1 || true)" if [ -n "${ERRS}" ]; then echo "FAIL"