On Wed, Dec 7, 2011 at 6:29 PM, John Sumsion <[email protected]> wrote: > From 4a26847342e3b33217f0682af4e350b71098befe Mon Sep 17 00:00:00 2001 > From: John Sumsion <[email protected]> > Date: Sat, 3 Dec 2011 09:36:52 -0700 > Subject: [PATCH 3/3] makepkg: Making git support do auto-clone/fetch. > > Patterned after the hg logic. Holy cow. You might want to take some of what I said in the previous patch with a grain of salt, because I was *totally* unaware we have and check for useless variables such as _gitroot right now, and yet don't actually use them for anything except checking they are not blank.
Now I'm not saying this is all going to be fixed at once, nor should it be, but I'd like to point you in the direction of https://bugs.archlinux.org/task/16872 and the 9 related reports. This is a big enough deal that I think we need some research done on the "state of VCS based PKGBUILDs" in order to make sure what we build is good enough to replace 95% of the ones with existing fetch boilerplate, and then go forward from there with the code. Mercurial is the current exception, not the rule (https://bugs.archlinux.org/task/16384), as far as VCS packaging goes. This bug (https://bugs.archlinux.org/task/19476) addresses the issue of downloading sources (along with FS#7816, FS#8890, FS#19459). Please don't let any of my feedback and comments discourage you- I'm glad to see you've stepped up and provided some work, which is what we sorely need in this area. I just want to let you know the magnitude of this elephant so we can make sure our finished product solves open issues and doesn't create several new ones. We also will need some documentation updates to explain everything we automate- where the repository checkout will be stored, whether it gets cloned, copied, etc. > Signed-off-by: John Sumsion <[email protected]> > --- > scripts/makepkg.sh.in | 10 ++++++++++ > 1 files changed, 10 insertions(+), 0 deletions(-) > > diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in > index 8a5eca0..83337fe 100644 > --- a/scripts/makepkg.sh.in > +++ b/scripts/makepkg.sh.in > @@ -1701,8 +1701,18 @@ devel_check() { > return 0 > fi > msg "$(gettext "Determining latest %s revision...")" > 'git' > + if [[ -d ./src/$_gitname ]] ; then > + cd ./src/$_gitname > + git remote update > + else > + [[ ! -d ./src/ ]] && mkdir ./src/ > + git clone $_gitroot/$_gitname ./src/$_gitname > + cd ./src/$_gitname > + fi > newpkgver=${_gitref:-origin/master} > + git reset --hard ${newpkgver} > newpkgver=$(git describe --always ${newpkgver} | sed > -e 's/-/_/g') > + cd ../../ > elif [[ -n ${_svntrunk} && -n ${_svnmod} ]] ; then > if ! type -p svn >/dev/null; then > warning "$(gettext "Cannot find the %s binary > required to > determine latest %s revision.")" "svn" "svn" > -- > 1.7.8 >
