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

Xavier Chantry chantry.xavier at gmail.com
Thu May 20 18:23:37 EDT 2010


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
---------------------------------------------------

However I usually don't bother with that. Most projects I work on, I
just use them locally if possible.
Only if needed, I install them system-wide, and then I don't care
about pacman not knowing the files. I can deal with that myself
without any problems.


More information about the aur-general mailing list