[aur-general] PKGBUILD that helps with VCS upstream contribution?

Philipp Überbacher hollunder at lavabit.com
Sun May 23 06:07:57 EDT 2010


Excerpts from Xavier Chantry's message of 2010-05-21 00:23:37 +0200:
> On Fri, May 21, 2010 at 12:01 AM, Philipp <hollunder at lavabit.com> wrote:
> > One of the reasons why I like Arch Linux so much is that it makes it
> > easy to work together with upstream. Through makepkg I can install the
> > latest, even VCS, version in a sane and very comfortable way.
> >
> > So far I've mainly been testing, reporting bugs, stuff like that, but
> > rarely needed to contribute any code.
> >
> > Now if I wanted to contribute code back to a project that uses git, how
> > would I do that without losing the comfort and safety of makepkg?
> > I figured it should be possible to write a PKGBUILD that gets the latest
> > upstream changes but also integrates local changes.
> >
> > Sadly both my bash and git skills are minimal, so I was wondering if
> > someone already has such a PKGBUILD, for git at least and maybe for svn
> > as well.
> >
> 
> Well that's very easy. The standard git PKGBUILDs use git clone / git
> pull with a remote URL.
> If you already have your own git repo locally, you have many ways to
> use that in the PKGBUILD :
> 1 - just switch to your git tree directory
> 2 - duplicate your git tree directory and put it inside $srcdir ,
> using git clone for example
> 3 - ... (there are probably other ways)
> 
> Here is an extract of a PKGBUILD for pacman using 2 :
> ---------------------------------------------------
> _gitroot=~/data/devel/pacman/pacman
> _gitname=working
> #_gitname=download
> 
> getgitsource() {
>   rm -rf $srcdir/pacman
>   git clone $_gitroot $srcdir/pacman || return 1
> }
> 
> build() {
>   getgitsource || return 1
> 
>   cd $srcdir/pacman
> 
>   git checkout origin/$_gitname || return 1
> 
>   msg "Building..."
>   ./autogen.sh

So you do follow upstream in a separate directory
(~/data/devel/pacman/pacman), make your changes there, resolve conflicts
if they arise, stuff like that. Then the PKGBUILD clones that git repo
and builds from it. Ok, sounds like a workable solution, thanks :)

I guess that works with svn and simple cp as well? The problem with svn
is probably getting the changes upstream?

-- 

Regards,
Philipp



More information about the aur-general mailing list