[openwrt/openwrt] scripts: getver.sh: fix version based on stable branch

LEDE Commits lede-commits at lists.infradead.org
Wed Oct 7 17:13:10 EDT 2020


adrian pushed a commit to openwrt/openwrt.git, branch openwrt-19.07:
https://git.openwrt.org/891022918d55b565b49b7ecafc4ebf8a66461a13

commit 891022918d55b565b49b7ecafc4ebf8a66461a13
Author: Baptiste Jonglez <git at bitsofnetworks.org>
AuthorDate: Thu Sep 3 23:19:07 2020 +0200

    scripts: getver.sh: fix version based on stable branch
    
    When building from a local branch based off the "openwrt-19.07" branch,
    version computation is wrong, for instance:
    
        r10194+1004-c53f62b111
    
    The number of local commits (1004 in this case) is wrong because it is
    computed against master.  As a result, it wrongly counts *all* commits
    since the beginning of the openwrt-19.07 branch as local commits.
    
    The fix is to compare to the openwrt-19.07 branch instead, which gives the
    expected result such as:
    
        r11192+6-8b0278a17e
    
    Signed-off-by: Baptiste Jonglez <git at bitsofnetworks.org>
    [shorten commit title]
    Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
---
 scripts/getver.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/getver.sh b/scripts/getver.sh
index 9175f411db..a0063505c3 100755
--- a/scripts/getver.sh
+++ b/scripts/getver.sh
@@ -26,7 +26,7 @@ try_git() {
 	*)
 		BRANCH="$(git rev-parse --abbrev-ref HEAD)"
 		ORIGIN="$(git rev-parse --verify --symbolic-full-name ${BRANCH}@{u} 2>/dev/null)"
-		[ -n "$ORIGIN" ] || ORIGIN="$(git rev-parse --verify --symbolic-full-name master@{u} 2>/dev/null)"
+		[ -n "$ORIGIN" ] || ORIGIN="$(git rev-parse --verify --symbolic-full-name openwrt-19.07@{u} 2>/dev/null)"
 		REV="$(git rev-list ${REBOOT}..$GET_REV | wc -l | awk '{print $1}')"
 
 		if [ -n "$ORIGIN" ]; then



More information about the lede-commits mailing list