buildroot: improve git submodule handling for packages

Move the `--recursive` switch from `git clone` to `git submodule`
so that submodules are cloned for upstream branches where the
PKG_SOURCE_VERSION commit-ish has a different .gitmodules
configuration than the repository default.

This is, for example, required when the master branch for a source
package does not use submodules, but its topic branch for OpenWRT
does.

This changes the buildroot dependency from git-1.6.2 to git 1.7.12.2,
which was released September 2012.

Signed-off-by: Darik Horn <dajhorn@vanadac.com>
Signed-off-by: Karl Palsson <karlp@tweak.net.au>

SVN-Revision: 48830
owl
Felix Fietkau 2016-02-29 20:12:25 +00:00
parent 076d58d344
commit 59121fdd69
2 changed files with 5 additions and 4 deletions

View File

@ -90,8 +90,9 @@ define DownloadMethod/git
cd $(TMP_DIR)/dl && \ cd $(TMP_DIR)/dl && \
rm -rf $(SUBDIR) && \ rm -rf $(SUBDIR) && \
[ \! -d $(SUBDIR) ] && \ [ \! -d $(SUBDIR) ] && \
git clone $(URL) $(SUBDIR) --recursive && \ git clone $(URL) $(SUBDIR) && \
(cd $(SUBDIR) && git checkout $(VERSION) && git submodule update) && \ (cd $(SUBDIR) && git checkout $(VERSION) && \
git submodule update --init --recursive) && \
echo "Packing checkout..." && \ echo "Packing checkout..." && \
rm -rf $(SUBDIR)/.git && \ rm -rf $(SUBDIR)/.git && \
$(call dl_pack,$(TMP_DIR)/dl/$(FILE),$(SUBDIR)) && \ $(call dl_pack,$(TMP_DIR)/dl/$(FILE),$(SUBDIR)) && \

View File

@ -154,8 +154,8 @@ $(eval $(call SetupHostCommand,python,Please install Python 2.x, \
$(eval $(call SetupHostCommand,svn,Please install the Subversion client, \ $(eval $(call SetupHostCommand,svn,Please install the Subversion client, \
svn --version | grep Subversion)) svn --version | grep Subversion))
$(eval $(call SetupHostCommand,git,Please install Git (git-core) >= 1.6.5, \ $(eval $(call SetupHostCommand,git,Please install Git (git-core) >= 1.7.12.2, \
git clone 2>&1 | grep -- --recursive)) git submodule update --help 2>&1 | grep -- --recursive))
$(eval $(call SetupHostCommand,file,Please install the 'file' package, \ $(eval $(call SetupHostCommand,file,Please install the 'file' package, \
file --version 2>&1 | grep file)) file --version 2>&1 | grep file))