diff --git a/Makefile b/Makefile index eaeb386..ca764d4 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ # Makefile for constructing RPMs. -SHELL := bash +SHELL := /bin/bash .SHELLFLAGS := -eu -o pipefail -c NAME = cephadm DIST ?= el8 @@ -33,7 +33,11 @@ echo: pre ## Print the passed (or computed) parameters @echo RELEASE $(RELEASE) patch: pre ## Build the latest patch - git diff $(PWD)/SOURCES/cephadm > $(PWD)/SOURCES/cephadm-$(VERSION)-$(RELEASE).patch + @git diff $(PWD)/SOURCES/cephadm > $(PWD)/SOURCES/cephadm-$(VERSION)-$(RELEASE).patch \ + $(eval SIZE := $(shell find SOURCES -name cephadm-$(VERSION)-$(RELEASE).patch -printf "%k")) + @if [[ $(SIZE) -eq 0 ]]; then \ + rm -f $(PWD)/SOURCES/cephadm-$(VERSION)-$(RELEASE).patch; \ + fi \ spec: pre ## Patch and build the cephadm spec file sed SPECS/cephadm.spec.in \