Skip to content

Commit d0c2c30

Browse files
committed
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 289172b) [ fix conflict error ] Signed-off-by: Christian Marangi <[email protected]>
1 parent 9c23ecf commit d0c2c30

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

target/sdk/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ GIT_COMMIT:=$(shell git rev-parse HEAD 2>/dev/null)
4444
GIT_BRANCH:=$(filter-out master main HEAD,$(shell git rev-parse --abbrev-ref HEAD 2>/dev/null))
4545
GIT_TAGNAME:=$(shell git show-ref --tags --dereference 2>/dev/null | sed -ne '/^$(GIT_COMMIT) / { s|^.*/||; s|\^.*||; p }')
4646

47-
BASE_FEED:=$(if $(GIT_URL),src-git-full base $(GIT_URL)$(if $(GIT_BRANCH),;$(GIT_BRANCH),$(if $(GIT_TAGNAME),;$(GIT_TAGNAME))))
47+
BASE_FEED:=$(if $(GIT_URL),src-git-full base $(GIT_URL)$(if $(GIT_TAGNAME),;$(GIT_TAGNAME),$(if $(GIT_BRANCH),;$(GIT_BRANCH))))
4848
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'))
4949
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'))
50-
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))))
50+
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))))
5151

5252
KDIR_BASE = $(patsubst $(TOPDIR)/%,%,$(LINUX_DIR))
5353
KDIR_ARCHES = $(LINUX_KARCH)

0 commit comments

Comments
 (0)