[pacman-dev] [PATCH 4/4] makepkg: git: update existing sources in srcdir without removing them first.

Lukas Jirkovsky l.jirkovsky at gmail.com
Wed Jun 18 04:49:08 EDT 2014


On 6 January 2014 02:35, Allan McRae <allan at archlinux.org> wrote:
>
> The news is I took a look a decided I will need to review the patch when
> I have a suitable block of time to do so.  This will definitely be
> before the next release.
>
> Allan
>
>

What is the status of these patches? I've been using them for git and
mercurial PKGBUILDs since they were first posted and I haven't seen a
single glitch yet.

Also, I wanted to share some of my opinions regarding the
implementation of updates with bazaar. I found out that the current
implementation doesn't use DVCS features effectively. I will
illustrate it on an example on how extract_bzr() works now:

1. bzr checkout "$dir" -r "$rev" --lightweight

    this does a lightweight checkout of $dir at a revision rev. "bzr
revno" shows the most recent revision (ie. the revision corresponding
to the "upstream" dir).

2. bzr pull "$dir" -q --overwrite -r "$rev"

    this basically synchronizes $dir and the checkout in $srcdir to
the revision $rev. Now "bzr revno" correctly returns $rev.
    However, the problem is that this apparently throws away any never
revisions from the repository clone in $dir. This means if the user
    wanted to update from an older revision to a newer revision they
would have to download the new revisions from the Internet again.


A found a solution, but it would require updating existing packages to
use "bzr revno --tree" instead of "bzr revno".

1. bzr checkout "$dir" --lightweight

   there is no problem in this, but checking out a specified revision
is kind of pointless now.

2. bzr update -q -r "$rev" &&

   This updates the working tree to the specified revision. The big
advantage of this approach is that it allows the
   user to move between revisions freely without needing to download
everything from the Internet all over again.

   The problem is that "bzr revno" will still return the newest
revision. That's because "bzr revno" returns the revision
   of the upstream and not the revision of the working directory. To
obtain the revision of the working directory one
   has to use "bzr revno --tree".

3. bzr revert && bzr clean-tree -q --detritus --force

  Needed only for the incremental updates. "bzr update" does an
automatic merge with the changes in the working directory.
  If there were conflicts, it will mark them in files in the same way
as git etc. by adding lines such as >>>> etc. "bzr revert"
  is used to revert the conflicting files to the repository version.
The automatic merge also sometimes leaves some backup files.
  These are cleaned up using the clean-tree command.


TLDR: bazaar is weird and the current implementation of bzr in makepkg
is kind of broken.

Lukas


More information about the pacman-dev mailing list