[pacman-dev] [PATCH] Update existing sources instead of removing them first for VCS sources.

Lukas Jirkovsky l.jirkovsky at gmail.com
Wed Oct 16 09:40:48 EDT 2013


On Sun, Oct 13, 2013 at 10:09 AM, Allan McRae <allan at archlinux.org> wrote:
> How about a set of patches:
>
> 1) Change SVN with your aforementioned reasoning.
> 2) Change SVN to use "cp -au" if the directory exists in $srcdir
> 3) Have git update itself rather than delete
> ...

Sounds OK to me.

> We will deal with hg/bzr once we have git working properly.

Mercurial shouldn't be a problem, I use it every day, compared to git
that I use rather scarcely.

But I guess it would make sense to change the Mercurial command from:
    hg pull -u
ie. pull and update (merging uncommitted changes) to:
    hg pull && hg update -C
which pulls the sources and updates them while discarding uncommitted changes.

> For git, the solution appears to be to always to do the "git checkout
> -B" if it is being updated, regardless of if it has a commit/tag/branch
> reference or not.  So the check will be:
>
> if [[ -n $ref ]] || (( updating ))
>
> where "updating" records whether or not there was a git checkout in
> $srcdir in the first place.

Is creating a branch actually necessary? git checkout should work just
fine when dealing with branches and commits and for tags the ref could
be prepended with "tags/" I don't know how big problem a detached head
would be. I suppose nobody sane would do a real development in
makepkg's repository though.

Lukas


More information about the pacman-dev mailing list