From owner-freebsd-git@FreeBSD.ORG Wed May 20 18:35:26 2015 Return-Path: Delivered-To: freebsd-git@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5453199B; Wed, 20 May 2015 18:35:26 +0000 (UTC) Received: from elvis.mu.org (elvis.mu.org [IPv6:2001:470:1f05:b76::196]) by mx1.freebsd.org (Postfix) with ESMTP id 4469B13C7; Wed, 20 May 2015 18:35:26 +0000 (UTC) Received: from AlfredMacbookAir.local (c-76-21-10-192.hsd1.ca.comcast.net [76.21.10.192]) by elvis.mu.org (Postfix) with ESMTPSA id D1B09341F87D; Wed, 20 May 2015 11:35:19 -0700 (PDT) Message-ID: <555CD3E7.7050001@freebsd.org> Date: Wed, 20 May 2015 11:35:19 -0700 From: Alfred Perlstein Organization: FreeBSD User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Jonathan Anderson , freebsd-ports@freebsd.org, freebsd-git@freebsd.org, Jonathan Anderson Subject: Re: USE_GITHUB and submodules References: <555B84AA.30901@FreeBSD.org> In-Reply-To: <555B84AA.30901@FreeBSD.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-git@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Discussion of git use in the FreeBSD project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2015 18:35:26 -0000 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