From 956f3558d4b619fb19eaa040614dfaf9a226d514 Mon Sep 17 00:00:00 2001 From: Klaus Wenninger Date: Mon, 28 Jun 2021 17:37:44 +0200 Subject: [PATCH] Build: Fix: correctly derive package version from git --- Makefile.am | 4 ++-- sbd.spec | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile.am b/Makefile.am index e614754..5d53c4c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -73,8 +73,8 @@ spec: sed -i 's/global\ build_counter.*/global\ build_counter\ $(COUNT)/' $(distdir)/$(PACKAGE).spec; \ echo $(COUNT) > $(BUILD_COUNTER); \ fi - if [ -n $(COMMIT_COUNTER) ]; then \ - sed -i 's/global\ commit_counter.*/global\ commit_counter\ $(COMMIT_COUNTER)-1/' $(distdir)/$(PACKAGE).spec; \ + if [ -n "$(COMMIT_COUNTER)" ]; then \ + sed -i 's/global\ commit_counter.*/global\ commit_counter\ $(COMMIT_COUNTER)/' $(distdir)/$(PACKAGE).spec; \ fi srpm: export spec diff --git a/sbd.spec b/sbd.spec index 776e48b..0498db1 100644 --- a/sbd.spec +++ b/sbd.spec @@ -20,7 +20,7 @@ %global modified %(echo %{longcommit}-|cut -f2 -d-) %global github_owner Clusterlabs %global commit_counter 0 -%global build_counter 1 +%global build_counter 0 %global buildnum %(expr %{commit_counter} + %{build_counter}) %ifarch s390x s390 -- 1.8.3.1