FS#43448 - Makepkg fails to detect Bazaar clones

Attached to Project: Pacman
Opened by Renato Silva (renatosilva) - Thursday, 15 January 2015, 00:02 GMT
Last edited by Allan McRae (Allan) - Saturday, 14 February 2015, 09:05 GMT
Task Type Bug Report
Category makepkg
Status Closed
Assigned To Allan McRae (Allan)
Architecture All
Severity Low
Priority Normal
Reported Version git
Due in Version 4.2.1
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

When makepkg updates a local Bazaar repository, it first checks if that local repository is "really a clone" from the remote repository specified in PKGBUILD. This check is buggy and I believe it is not necessary, because bzr pull does not try to merge commits. The pull command only succeeds if the remote repository contains all commits from the local repository.

For example, if you switch to a fork repository in PKGBUILD, and the local repository is a subset of the fork, next bzr pull will succeed to switch your local copy to the fork. If you then switch back to the original repository in PKGBUILD, then next bzr pull will fail anyway without manual checks, because the repositories have diverged. If the fork was not a superset of your local repository, bzr pull would have failed in the first place.

Therefore, no manual check is needed thanks to bzr pull. This is different from git pull, which may lead to merges, it seems. So it would be a mistake assuming equivalence between bzr pull and git pull. As shown below, this manual check has been added for git then copied without any reason for bzr. In fact, there is no such manual check for hg.

https://projects.archlinux.org/pacman.git/commit/?id=c926c39b0481ec3db931fff1f86db0c49d78976b
https://projects.archlinux.org/pacman.git/commit/?id=3b02f80dcb3159a7ab0c673d5eae971ad7504e7f

If those manual Bazaar checks worked, it would be simply useless code (unless there are cases where bzr pull is not enough). But they are buggy, as I explained in a proposed commit for MSYS2 pacman and which is reproduced in the mailing list thread below. Thanks Florian for the link to git commit. Allan, I hope to have clarified why bzr pull would fail. So I propose a patch like the one attached.

https://lists.archlinux.org/pipermail/pacman-dev/2015-January/019786.html
This task depends upon

Closed by  Allan McRae (Allan)
Saturday, 14 February 2015, 09:05 GMT
Reason for closing:  Fixed
Additional comments about closing:  git commit 0927206fc
Comment by Renato Silva (renatosilva) - Thursday, 15 January 2015, 21:57 GMT
Here is an up-to-date patch with a proposed commit message.
Comment by Allan McRae (Allan) - Thursday, 12 February 2015, 06:24 GMT
Pulled to my patchqueue branch.

Loading...