[Buildroot] [PATCH] Makefile.package.in: GIT: add support to fetch git submodules

Arnout Vandecappelle arnout at mind.be
Tue Feb 28 22:32:28 UTC 2012


On Tuesday 28 February 2012 13:25:19 Alexandre Pereira da Silva wrote:
> Signed-off-by: Alexandre Pereira da Silva <aletes.xgr at gmail.com>
> ---
>  package/Makefile.package.in |   10 ++++++----
>  1 files changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/package/Makefile.package.in b/package/Makefile.package.in
> index ea44c6c..863e866 100644
> --- a/package/Makefile.package.in
> +++ b/package/Makefile.package.in
> @@ -147,13 +147,15 @@ domainseparator=$(if $(1),$(1),/)
>  define DOWNLOAD_GIT
>  	test -e $(DL_DIR)/$($(PKG)_SOURCE) || \
>  	(pushd $(DL_DIR) > /dev/null && \
> -	$(GIT) clone --bare $($(PKG)_SITE) $($(PKG)_BASE_NAME) && \
> +	$(GIT) clone -n $($(PKG)_SITE) $($(PKG)_BASE_NAME) && \
>  	pushd $($(PKG)_BASE_NAME) > /dev/null && \
> -	$(GIT) archive --format=tar --prefix=$($(PKG)_BASE_NAME)/ $($(PKG)_DL_VERSION) | \
> -		gzip -c > $(DL_DIR)/$($(PKG)_SOURCE) && \
> +	$(GIT) checkout $($(PKG)_VERSION) && \
> +	$(GIT) submodule init && \
> +	$(GIT) submodule update && \
> +	$(TAR) czf $(DL_DIR)/$($(PKG)_SOURCE) . &&\
>  	popd > /dev/null && \
>  	rm -rf $($(PKG)_DL_DIR) && \
> -	popd > /dev/null)
> +	popd > /dev/null)    
>  endef
>  
>  # TODO: improve to check that the given PKG_DL_VERSION exists on the remote

 I'm a bit concerned with the impact this will have on performance, e.g.
when cloning a linux git.  Could you evaluate that?

 Regards,
 Arnout

-- 
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F


More information about the buildroot mailing list