[openwrt/openwrt] sdk: invert logic for GIT_BRANCH and GIT_TAGNAME
LEDE Commits
lede-commits at lists.infradead.org
Thu Dec 4 10:26:20 PST 2025
ansuel pushed a commit to openwrt/openwrt.git, branch openwrt-24.10:
https://git.openwrt.org/d0c2c30e5072cc917599a2d8b328a5c6560326c7
commit d0c2c30e5072cc917599a2d8b328a5c6560326c7
Author: Christian Marangi <ansuelsmth at gmail.com>
AuthorDate: Thu Dec 4 19:11:17 2025 +0100
sdk: invert logic for GIT_BRANCH and GIT_TAGNAME
There is currently a logic error with generating the base feed string.
In the scenario where the commit of a Tag match the latest commit of a
stable branch, the stable branch have priority over the tag name.
This results in generating SDK that actually target the branch instead
of the specific tag.
To fix this invert the logic and give priority to the tag name.
Fixes: #18583
(cherry picked from commit 289172b00e7193df8a2afa1eee54b43148470698)
[ fix conflict error ]
Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
target/sdk/Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/target/sdk/Makefile b/target/sdk/Makefile
index da1fb949ef..48b8833ffe 100644
--- a/target/sdk/Makefile
+++ b/target/sdk/Makefile
@@ -44,10 +44,10 @@ GIT_COMMIT:=$(shell git rev-parse HEAD 2>/dev/null)
GIT_BRANCH:=$(filter-out master main HEAD,$(shell git rev-parse --abbrev-ref HEAD 2>/dev/null))
GIT_TAGNAME:=$(shell git show-ref --tags --dereference 2>/dev/null | sed -ne '/^$(GIT_COMMIT) / { s|^.*/||; s|\^.*||; p }')
-BASE_FEED:=$(if $(GIT_URL),src-git-full base $(GIT_URL)$(if $(GIT_BRANCH),;$(GIT_BRANCH),$(if $(GIT_TAGNAME),;$(GIT_TAGNAME))))
+BASE_FEED:=$(if $(GIT_URL),src-git-full base $(GIT_URL)$(if $(GIT_TAGNAME),;$(GIT_TAGNAME),$(if $(GIT_BRANCH),;$(GIT_BRANCH))))
BASE_FEED:=$(if $(BASE_FEED),$(BASE_FEED),$(shell cd $(TOPDIR); LC_ALL=C git svn info 2>/dev/null | sed -ne 's/^URL: /src-gitsvn base /p'))
BASE_FEED:=$(if $(BASE_FEED),$(BASE_FEED),$(shell cd $(TOPDIR); LC_ALL=C svn info 2>/dev/null | sed -ne 's/^URL: /src-svn base /p'))
-BASE_FEED:=$(if $(BASE_FEED),$(BASE_FEED),src-git-full base $(PROJECT_GIT)/openwrt/openwrt.git$(if $(GIT_BRANCH),;$(GIT_BRANCH),$(if $(GIT_TAGNAME),;$(GIT_TAGNAME))))
+BASE_FEED:=$(if $(BASE_FEED),$(BASE_FEED),src-git-full base $(PROJECT_GIT)/openwrt/openwrt.git$(if $(GIT_TAGNAME),;$(GIT_TAGNAME),$(if $(GIT_BRANCH),;$(GIT_BRANCH))))
KDIR_BASE = $(patsubst $(TOPDIR)/%,%,$(LINUX_DIR))
KDIR_ARCHES = $(LINUX_KARCH)
More information about the lede-commits
mailing list