From 5bfcb9dff92081f45d4d4173494048a6df7cc9ee Mon Sep 17 00:00:00 2001 From: Andrey Smirnov Date: Wed, 26 May 2021 19:10:18 +0300 Subject: [PATCH] chore: remove parsebool script The reason is same as in talos-systems/talos#3678, it breaks release-tool. Signed-off-by: Andrey Smirnov --- Makefile | 4 ++-- hack/parsebool.sh | 16 ---------------- 2 files changed, 2 insertions(+), 18 deletions(-) delete mode 100755 hack/parsebool.sh diff --git a/Makefile b/Makefile index 0cb840cef..6f5f0b60a 100644 --- a/Makefile +++ b/Makefile @@ -23,13 +23,13 @@ GO_LDFLAGS ?= WITH_RACE ?= false WITH_DEBUG ?= false -ifeq ($(shell hack/parsebool.sh $(WITH_RACE); echo $$?), 1) +ifneq (, $(filter $(WITH_RACE), t true TRUE y yes 1)) CGO_ENABLED = 1 GO_BUILDFLAGS += -race GO_LDFLAGS += -linkmode=external -extldflags '-static' endif -ifeq ($(shell hack/parsebool.sh $(WITH_DEBUG); echo $$?), 1) +ifneq (, $(filter $(WITH_DEBUG), t true TRUE y yes 1)) GO_BUILDFLAGS += -tags sidero.debug else GO_LDFLAGS += -s -w diff --git a/hack/parsebool.sh b/hack/parsebool.sh deleted file mode 100755 index 5c0e08630..000000000 --- a/hack/parsebool.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -# parsebool.sh exits with code: -# 0 if passed argument is false, FALSE, f, 0, etc -# 1 if passed argument is true, TRUE, t, 1, etc -# 2 if passed argument is absent, an empty string or something else - -set -e - -arg=$(echo $* | tr '[:upper:]' '[:lower:]') - -case $arg in - false|f|0) exit 0 ;; - true|t|1) exit 1 ;; - *) exit 2 ;; -esac