diff mbox

[OpenWrt-Devel] buildroot: improve git submodule handling for packages

Message ID CAPbcu1OoTPnN6cGzi9-Qegk0evd7RDQSC-SQ2XCiwo4eR-r5XQ@mail.gmail.com
State Changes Requested
Delegated to: Felix Fietkau
Headers show

Commit Message

Darik Horn May 15, 2015, 2:25 p.m. UTC
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>
---
 include/download.mk     | 5 +++--
 include/prereq-build.mk | 4 ++--
 2 files changed, 5 insertions(+), 4 deletions(-)

  file --version 2>&1 | grep file))

Comments

Felix Fietkau July 15, 2015, 8:08 a.m. UTC | #1
On 2015-05-15 16:25, Darik Horn wrote:
> 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>
> ---
Patch is badly whitespace mangled and does not apply.

- Felix
diff mbox

Patch

diff --git a/include/download.mk b/include/download.mk
index adaa2e6..d593344 100644
--- a/include/download.mk
+++ b/include/download.mk
@@ -88,8 +88,9 @@  define DownloadMethod/git
  cd $(TMP_DIR)/dl && \
  rm -rf $(SUBDIR) && \
  [ \! -d $(SUBDIR) ] && \
- git clone $(URL) $(SUBDIR) --recursive && \
- (cd $(SUBDIR) && git checkout $(VERSION) && git submodule update) && \
+ git clone $(URL) $(SUBDIR) && \
+ (cd $(SUBDIR) && git checkout $(VERSION) && \
+  git submodule update --init --recursive) && \
  echo "Packing checkout..." && \
  rm -rf $(SUBDIR)/.git && \
  $(call dl_pack,$(TMP_DIR)/dl/$(FILE),$(SUBDIR)) && \
diff --git a/include/prereq-build.mk b/include/prereq-build.mk
index 211201a..c06adaf 100644
--- a/include/prereq-build.mk
+++ b/include/prereq-build.mk
@@ -144,8 +144,8 @@  $(eval $(call SetupHostCommand,python,Please
install Python 2.x, \
 $(eval $(call SetupHostCommand,svn,Please install the Subversion client, \
  svn --version | grep Subversion))

-$(eval $(call SetupHostCommand,git,Please install Git (git-core) >= 1.6.5, \
- git clone 2>&1 | grep -- --recursive))
+$(eval $(call SetupHostCommand,git,Please install Git (git-core) >= 1.7.12.2, \
+ git submodule update --help 2>&1 | grep -- --recursive))

 $(eval $(call SetupHostCommand,file,Please install the 'file' package, \