From 26af5c5cb5c974512b90544f207528f1594631bd Mon Sep 17 00:00:00 2001 From: Francesco Pantano Date: Jun 09 2021 11:55:27 +0000 Subject: Fix Default size when the patch file is not found --- diff --git a/Makefile b/Makefile index ca764d4..f3834b8 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ # Makefile for constructing RPMs. -SHELL := /bin/bash +SHELL := bash .SHELLFLAGS := -eu -o pipefail -c NAME = cephadm DIST ?= el8 @@ -13,6 +13,7 @@ SPECTOOL :=$(shell which spectool) RPMBUILD :=$(shell which rpmbuild) RELEASE := $(if $(RELEASE),$(RELEASE),$(LAST_RELEASE)) VERSION := $(if $(VERSION),$(VERSION),$(LAST_VERSION)) +DEFAULT_SIZE := 0 all: spec src srpm @@ -35,7 +36,8 @@ echo: pre ## Print the passed (or computed) parameters patch: pre ## Build the latest 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 \ + @SIZE=$(if $(SIZE),$(SIZE),$(DEFAULT_SIZE)) + @if [[ "$(SIZE)" -eq 0 ]]; then \ rm -f $(PWD)/SOURCES/cephadm-$(VERSION)-$(RELEASE).patch; \ fi \