Date: Wed, 20 May 2015 11:35:19 -0700 From: Alfred Perlstein <alfred@freebsd.org> To: Jonathan Anderson <jonathan@FreeBSD.org>, freebsd-ports@freebsd.org, freebsd-git@freebsd.org, Jonathan Anderson <jonathan@FreeBSD.org> Subject: Re: USE_GITHUB and submodules Message-ID: <555CD3E7.7050001@freebsd.org> In-Reply-To: <555B84AA.30901@FreeBSD.org> References: <555B84AA.30901@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On 5/19/15 11:44 AM, Jonathan Anderson wrote: > Hi all, > > Is there a mechanism for using the USE_GITHUB variable in a port that > depends on submodules? For instance, the Rust port requires an embedded > (and modified) version of LLVM, which it includes as a submodule. Right > now I'm attempting to add the following to a `post-extract` rule: > > post-extract: > cd ${WRKSRC} && \ > git init && \ > git remote add origin https://github.com/${GH_ACCOUNT}/${PORTNAME} && \ > git fetch && \ > git reset --hard ${PORTVERSION} && \ > git submodule init && \ > git submodule update --recursive > > But this seems quite hackish! It would be great if submodules Just > Worked... but alternatively, is there a USE_GITHUB_URL or somesuch that > would check things out via Git instead of tarball to save me the `git > init` through `git reset` steps? > Hello, Please just try adding an option for fetch target to do this: post-extract: cd ${WRKSRC} && \ git submodule update --init --recursive You should not need all the other things such as: post-extract: cd ${WRKSRC} && \ git init && \ git remote add originhttps://github.com/${GH_ACCOUNT}/${PORTNAME} && \ git fetch && \ git reset --hard ${PORTVERSION} && \ git submodule init && \ git submodule update --recursive Since submodules are based on git hashes, there should not be a security issue. All that's needed is that the git ports hook for extracting needs an optional "git submodule update --init --recursive" step added to it. -Alfred
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?555CD3E7.7050001>