From 53cb36447f0973242314ecd8592a5b172a6ceac0 Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Thu, 21 May 2020 11:05:09 +0200 Subject: [PATCH] make release: make sure it's executed from a clean master --- Makefile | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 6b0a6cb76..71d61f091 100644 --- a/Makefile +++ b/Makefile @@ -238,11 +238,17 @@ endif release: VERSION="v4.$(shell git log --oneline master | wc -l)" release: +ifneq ($(shell git rev-parse --abbrev-ref HEAD),master) + $(error "!!! you are not on master branch, aborting") +endif +ifeq ($(shell git describe --dirty --always|grep -o dirty),dirty) + $(error "!!! you have pending changes, aborting") +endif +ifeq ($(RELEASE_NAME),) + $(error "!!! missing RELEASE_NAME, aborting") +endif # Preparing a commit for release tagging, to be reverted after tagging. @echo "# - Release Tag: $(VERSION)" -ifeq ($(RELEASE_NAME),) - $(error "!!! missing RELEASE_NAME") -endif @echo "# - Release Name: $(RELEASE_NAME)" # - Removing -Werror... @find . \( -path "./Makefile.defs" -or -path "./client/Makefile" -or -path "./common_arm/Makefile.common" -or -path "./tools/hitag2crack/*/Makefile" \) -exec sed -i 's/ -Werror//' {} \;