rules: fix empty COMMITCOUNT/AUTORELEASE
authorPaul Spooren <mail@aparcar.org>
Fri, 29 Jan 2021 09:17:10 +0000 (23:17 -1000)
committerPaul Spooren <mail@aparcar.org>
Sat, 30 Jan 2021 22:21:58 +0000 (12:21 -1000)
Packages that are in-tree only often lack a PKG_VERSION and only use the
PKG_RELEASE to mark changes. Using COMMITCOUNT/AUTORELEASE variables
causes an issue as both variables are empty during the metadata DUMP
phase.

Instead of leaving these variables empty and causing an error message
like below, set the variables to 0 during dumping. On actual building
the variable is evaluated causing in a value above 0.

ERROR: please fix package/utils/px5g-wolfssl/Makefile - \
see logs/package/utils/px5g-wolfssl/dump.txt for details

Makefile:48: *** Package/px5g-wolfssl is missing the VERSION field.  Stop.

Reported-by: Daniel Golle <daniel@makrotopia.org>
Reported-by: Stijn Segers <foss@volatilesystems.org>
Reported-by: Stijn Tintel <stijn@linux-ipv6.be>
Signed-off-by: Paul Spooren <mail@aparcar.org>
rules.mk

index b1b69eabf9ea735d9f1c41446e80c6a4a6c4308a..b658e9302084b7bb31d7ffbdc36e9df664c2b61e 100644 (file)
--- a/rules.mk
+++ b/rules.mk
@@ -431,8 +431,8 @@ $(shell \
 )
 endef
 
-COMMITCOUNT = $(if $(DUMP),,$(call commitcount))
-AUTORELEASE = $(if $(DUMP),,$(call commitcount,1))
+COMMITCOUNT = $(if $(DUMP),0,$(call commitcount))
+AUTORELEASE = $(if $(DUMP),0,$(call commitcount,1))
 
 all:
 FORCE: ;