firmware/build_patches/openwrt/0023-rules-fix-empty-COMMIT...

40 lines
1.4 KiB
Diff

From: Paul Spooren <mail@aparcar.org>
Date: Thu, 28 Jan 2021 23:17:10 -1000
Subject: rules: fix empty COMMITCOUNT/AUTORELEASE
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>
(cherry picked from commit ddab795b370da986149f8c8e6b3455bf9c1066fe)
diff --git a/rules.mk b/rules.mk
index 8bfc67fb2cd43e3ce4330fd28b398722858d3493..ee586bf989498b564b4de03b10b68cf66506d3d5 100644
--- a/rules.mk
+++ b/rules.mk
@@ -427,8 +427,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: ;