FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux User Repository

 
 
LinkBack Thread Tools
 
Old 05-20-2010, 10:23 PM
Xavier Chantry
 
Default PKGBUILD that helps with VCS upstream contribution?

On Fri, May 21, 2010 at 12:01 AM, Philipp <hollunder@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.
 
Old 05-23-2010, 10:00 AM
Philipp Überbacher
 
Default PKGBUILD that helps with VCS upstream contribution?

Excerpts from Daenyth Blank's message of 2010-05-21 00:03:53 +0200:
> On Thu, May 20, 2010 at 18:01, Philipp <hollunder@lavabit.com> wrote:
> > 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.
>
> Fork their git repo (github makes this easy), add and commit your
> changes, and set your PKGBUILD to use your forked version. You can use
> git format-patch to send things back to them, or send a pull request
> through github or some other medium. The individual project will
> determine what's the best method.

Ah, yes. I don't remember whether github can follow upstream or whether
I have to do that manually and push to github.
I think it's a nice way to do it, since github is always available and
upstream can pull (which may or may not work locally).

But a number of projects still use svn (I even know at least one that
uses cvs) and this approach won't work there afaik.
--

Regards,
Philipp
 
Old 05-23-2010, 10:07 AM
Philipp Überbacher
 
Default PKGBUILD that helps with VCS upstream contribution?

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@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
 
Old 05-24-2010, 10:50 AM
Xavier Chantry
 
Default PKGBUILD that helps with VCS upstream contribution?

On Sun, May 23, 2010 at 12:07 PM, Philipp Überbacher
<hollunder@lavabit.com> wrote:
>
> 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
>

That's it.

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

I don't know any VCS that automate the process of getting the changes
upstream, but we can dream.
 

Thread Tools




All times are GMT. The time now is 07:02 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org