diff --git a/Makefile b/Makefile index 6e1916a..b1a838a 100644 --- a/Makefile +++ b/Makefile @@ -48,6 +48,10 @@ FORCE: noop: # do nothing +# Set empty value for MAKECMDGOALS to prevent the "warning: undefined variable 'MAKECMDGOALS'" +# warning from happening when running make without arguments +MAKECMDGOALS ?= + ################################## # Host OS and architecture setup # ################################## diff --git a/klone.yaml b/klone.yaml index dbcfbaf..34b2bf0 100644 --- a/klone.yaml +++ b/klone.yaml @@ -9,60 +9,60 @@ targets: - folder_name: api-docs repo_url: https://github.com/cert-manager/makefile-modules.git repo_ref: main - repo_hash: ad721163bbe8d8d755d54c88a2b2475aeb7c79de + repo_hash: 9b0502fdd5860b18fd6a9ddf86f148604a214fe4 repo_path: modules/api-docs - folder_name: boilerplate repo_url: https://github.com/cert-manager/makefile-modules.git repo_ref: main - repo_hash: ad721163bbe8d8d755d54c88a2b2475aeb7c79de + repo_hash: 9b0502fdd5860b18fd6a9ddf86f148604a214fe4 repo_path: modules/boilerplate - folder_name: cert-manager repo_url: https://github.com/cert-manager/makefile-modules.git repo_ref: main - repo_hash: ad721163bbe8d8d755d54c88a2b2475aeb7c79de + repo_hash: 9b0502fdd5860b18fd6a9ddf86f148604a214fe4 repo_path: modules/cert-manager - folder_name: controller-gen repo_url: https://github.com/cert-manager/makefile-modules.git repo_ref: main - repo_hash: ad721163bbe8d8d755d54c88a2b2475aeb7c79de + repo_hash: 9b0502fdd5860b18fd6a9ddf86f148604a214fe4 repo_path: modules/controller-gen - folder_name: generate-verify repo_url: https://github.com/cert-manager/makefile-modules.git repo_ref: main - repo_hash: ad721163bbe8d8d755d54c88a2b2475aeb7c79de + repo_hash: 9b0502fdd5860b18fd6a9ddf86f148604a214fe4 repo_path: modules/generate-verify - folder_name: go repo_url: https://github.com/cert-manager/makefile-modules.git repo_ref: main - repo_hash: ad721163bbe8d8d755d54c88a2b2475aeb7c79de + repo_hash: 9b0502fdd5860b18fd6a9ddf86f148604a214fe4 repo_path: modules/go - folder_name: help repo_url: https://github.com/cert-manager/makefile-modules.git repo_ref: main - repo_hash: ad721163bbe8d8d755d54c88a2b2475aeb7c79de + repo_hash: 9b0502fdd5860b18fd6a9ddf86f148604a214fe4 repo_path: modules/help - folder_name: kind repo_url: https://github.com/cert-manager/makefile-modules.git repo_ref: main - repo_hash: ad721163bbe8d8d755d54c88a2b2475aeb7c79de + repo_hash: 9b0502fdd5860b18fd6a9ddf86f148604a214fe4 repo_path: modules/kind - folder_name: klone repo_url: https://github.com/cert-manager/makefile-modules.git repo_ref: main - repo_hash: ad721163bbe8d8d755d54c88a2b2475aeb7c79de + repo_hash: 9b0502fdd5860b18fd6a9ddf86f148604a214fe4 repo_path: modules/klone - folder_name: oci-build repo_url: https://github.com/cert-manager/makefile-modules.git repo_ref: main - repo_hash: ad721163bbe8d8d755d54c88a2b2475aeb7c79de + repo_hash: 9b0502fdd5860b18fd6a9ddf86f148604a214fe4 repo_path: modules/oci-build - folder_name: repository-base repo_url: https://github.com/cert-manager/makefile-modules.git repo_ref: main - repo_hash: ad721163bbe8d8d755d54c88a2b2475aeb7c79de + repo_hash: 9b0502fdd5860b18fd6a9ddf86f148604a214fe4 repo_path: modules/repository-base - folder_name: tools repo_url: https://github.com/cert-manager/makefile-modules.git repo_ref: main - repo_hash: ad721163bbe8d8d755d54c88a2b2475aeb7c79de + repo_hash: 9b0502fdd5860b18fd6a9ddf86f148604a214fe4 repo_path: modules/tools diff --git a/make/_shared/generate-verify/util/verify.sh b/make/_shared/generate-verify/util/verify.sh index 0416c67..4dbaefa 100755 --- a/make/_shared/generate-verify/util/verify.sh +++ b/make/_shared/generate-verify/util/verify.sh @@ -44,8 +44,7 @@ cleanup() { } trap "cleanup" EXIT SIGINT -cp -a "${projectdir}/." "${tmp}" -rm -rf "${tmp}/_bin" # clear all cached files +rsync -aEq "${projectdir}/." "${tmp}" --exclude "_bin/" pushd "${tmp}" >/dev/null "$@" diff --git a/make/_shared/help/help.sh b/make/_shared/help/help.sh index 96c4ad8..d9c831f 100755 --- a/make/_shared/help/help.sh +++ b/make/_shared/help/help.sh @@ -14,7 +14,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -set -eu -o pipefail +set -o errexit +set -o nounset +set -o pipefail ## 1. Build set of extracted line items diff --git a/make/_shared/repository-base/base/Makefile b/make/_shared/repository-base/base/Makefile index 6e1916a..b1a838a 100644 --- a/make/_shared/repository-base/base/Makefile +++ b/make/_shared/repository-base/base/Makefile @@ -48,6 +48,10 @@ FORCE: noop: # do nothing +# Set empty value for MAKECMDGOALS to prevent the "warning: undefined variable 'MAKECMDGOALS'" +# warning from happening when running make without arguments +MAKECMDGOALS ?= + ################################## # Host OS and architecture setup # ################################## diff --git a/make/_shared/tools/00_mod.mk b/make/_shared/tools/00_mod.mk index 2e76fd1..7a7ed44 100644 --- a/make/_shared/tools/00_mod.mk +++ b/make/_shared/tools/00_mod.mk @@ -576,6 +576,7 @@ $(DOWNLOAD_DIR)/tools/rclone@$(RCLONE_VERSION)_$(HOST_OS)_$(HOST_ARCH): | $(DOWN MISSING=$(shell (command -v curl >/dev/null || echo curl) \ && (command -v sha256sum >/dev/null || command -v shasum >/dev/null || echo sha256sum) \ && (command -v git >/dev/null || echo git) \ + && (command -v rsync >/dev/null || echo rsync) \ && ([ -n "$(findstring vendor-go,$(MAKECMDGOALS),)" ] \ || command -v $(GO) >/dev/null || echo "$(GO) (or run 'make vendor-go')") \ && (command -v $(CTR) >/dev/null || echo "$(CTR) (or set CTR to a docker-compatible tool)")) diff --git a/make/_shared/tools/util/checkhash.sh b/make/_shared/tools/util/checkhash.sh index f626f6f..62e5489 100755 --- a/make/_shared/tools/util/checkhash.sh +++ b/make/_shared/tools/util/checkhash.sh @@ -14,7 +14,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -set -eu -o pipefail +set -o errexit +set -o nounset +set -o pipefail SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" diff --git a/make/_shared/tools/util/hash.sh b/make/_shared/tools/util/hash.sh index 3e58bfc..21d006f 100755 --- a/make/_shared/tools/util/hash.sh +++ b/make/_shared/tools/util/hash.sh @@ -14,7 +14,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -set -eu -o pipefail +set -o errexit +set -o nounset +set -o pipefail # This script is a wrapper for outputting purely the sha256 hash of the input file, # ideally in a portable way. diff --git a/make/_shared/tools/util/lock.sh b/make/_shared/tools/util/lock.sh index 6c6a7b8..d3c437e 100755 --- a/make/_shared/tools/util/lock.sh +++ b/make/_shared/tools/util/lock.sh @@ -14,7 +14,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -set -eu -o pipefail +set -o errexit +set -o nounset +set -o pipefail # This script is used to lock a file while it is being downloaded. It prevents # multiple processes from downloading the same file at the same time or from reading @@ -66,6 +68,5 @@ finish() { rm -rf "$finalfile" || true fi rm -rf "$lockfile" || true - exit $rv } -trap finish EXIT +trap finish EXIT SIGINT