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

LEDE Commits lede-commits at lists.infradead.org
Sun Feb 21 12:43:19 EST 2021


zorun pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/cb5c93f12ad45f646089be6473c1c70005800020

commit cb5c93f12ad45f646089be6473c1c70005800020
Author: Baptiste Jonglez <git at bitsofnetworks.org>
AuthorDate: Sun Feb 21 18:42:38 2021 +0100

    scripts: getver.sh: fix version based on stable branch
    
    When building from a local branch based off the "openwrt-21.02" branch,
    version computation is wrong, because the number of local commits is
    computed against master.  As a result, it wrongly counts *all* commits
    since the beginning of the openwrt-21.02 branch as local commits.
    
    The fix is to compare to the openwrt-21.02 branch instead, which gives the
    expected result.
    
    A similar change had been applied to the openwrt-19.07 branch:
    891022918d55 ("scripts: getver.sh: fix version based on stable branch")
    
    Signed-off-by: Baptiste Jonglez <git at bitsofnetworks.org>
---
 scripts/getver.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/getver.sh b/scripts/getver.sh
index 49260a2260..dc3d1bb1c3 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-21.02@{u} 2>/dev/null)"
 		REV="$(git rev-list ${REBOOT}..$GET_REV 2>/dev/null | wc -l | awk '{print $1}')"
 
 		if [ -n "$ORIGIN" ]; then



More information about the lede-commits mailing list