[openwrt/openwrt] rules: fix COMMITCOUNT logic

LEDE Commits lede-commits at lists.infradead.org
Tue Jan 26 22:30:41 EST 2021


aparcar pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/513f7171a3e509bba54ecc2af2d6259c7cbff221

commit 513f7171a3e509bba54ecc2af2d6259c7cbff221
Author: Paul Spooren <mail at aparcar.org>
AuthorDate: Tue Jan 26 17:16:36 2021 -1000

    rules: fix COMMITCOUNT logic
    
    The newly added $(COMMITCOUNT) variable was wrongly increased by plus
    one. The addition should have been only added to $(AUTORELEASE) as
    OpenWrt traditionally starts counting at one rather than zero.
    
    $(AUTORELEASE) counts the commits since the last bump, which is zero on
    the version bump commit itself.
    
    This commit increases $(AUTORELEASE) by one while leaving $(COMMITCOUNT)
    as is.
    
    The base-files package is the only package using $(COMMITCOUNT) so far
    and requires a pseudo commit to keep the PKG_RELEASE correct. A non
    functional change (Copyright bump) is done in the next commit.
    
    Signed-off-by: Paul Spooren <mail at aparcar.org>
---
 rules.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/rules.mk b/rules.mk
index cf4aa30d21..b1b69eabf9 100644
--- a/rules.mk
+++ b/rules.mk
@@ -421,7 +421,7 @@ $(shell \
     if [ -n "$$last_bump" ]; then \
       echo -n $$(($$(git rev-list --count "$$last_bump..HEAD" .) + 1)); \
     else \
-      echo -n $$(($$(git rev-list --count HEAD .) + 1)); \
+      git rev-list --count HEAD .; \
     fi; \
   else \
     secs="$$(($(SOURCE_DATE_EPOCH) % 86400))"; \



More information about the lede-commits mailing list