CC: sdk: add base repository fallback
authorJo-Philipp Wich <jow@openwrt.org>
Tue, 12 Jan 2016 09:27:30 +0000 (09:27 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Tue, 12 Jan 2016 09:27:30 +0000 (09:27 +0000)
When the build system cannot infer its own repository url then let it fall
back to http://git.openwrt.org/ for the base feed.

The path to openwrt.git is guessed from the VERSION_NUMBER variable:

 "unknown" or "r12345" -> http://git.openwrt.org/openwrt.git
 "15.05.1"             -> http://git.openwrt.org/15.05/openwrt.git

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
Backport of r48212

SVN-Revision: 48213

target/sdk/Makefile

index d81c2375e087acf2f68d656d93b5f87e8d6f9b4c..cf53a48eb90ade8f61559e4e7da09e4489a636ec 100644 (file)
@@ -39,6 +39,7 @@ SDK_DIRS = \
 BASE_FEED:=$(shell git config --get remote.origin.url 2>/dev/null | sed -ne 's/^/src-git base /p')
 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 base https://git.openwrt.org/$(filter-out unknown/ r%/,$(subst $(space),.,$(wordlist 1,2,$(subst .,$(space),$(VERSION_NUMBER))))/)openwrt.git)
 
 KDIR_BASE = $(patsubst $(TOPDIR)/%,%,$(LINUX_DIR))