Fix Bazaar cloning in makepkg.

There was some manual check to know if the local repository was really a clone
of the one specified in PKGBUILD. This check has been removed because it is
buggy and not necessary.

It is buggy because this check needs to be semantic, not a simple string
comparison. For example, I was blocked from building a PKGBUILD because Bazaar
was returning two different strings for the same location (for HTTP one was
url-encoded while the other was not, and for local paths one was absolute while
the other was relative). While this may be a bug in Bazaar, the check is
unreliable since the comparison is not semantic (http://foo.com/%2Bplus and
http://foo.com/+plus obviously refer to the same location for example).

Specially, it is useless because the intention is updating the existing local
clone. However, if the local clone is not a real clone of the repository
specified in PKGBUILD (which was what this buggy check tried to tell), next step
which is a pull operation will fail anyway. This is because bzr pull does not
perform merges, it just makes one branch into a mirror of another.

There was a reason provided when this manual check was added for Git, but no
reason provided for copying such check when Bazaar support was added, see
commits below. In fact, Mercurial lacks such manual check.

* c926c39b04
* 3b02f80dcb

Fixes FS#43448.

Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Renato Silva 2015-01-15 19:47:07 -02:00 committed by Allan McRae
parent ba869597fb
commit 0927206fc4
1 changed files with 0 additions and 17 deletions

View File

@ -471,23 +471,6 @@ download_bzr() {
exit 1
fi
elif (( ! HOLDVER )); then
# Make sure we are fetching the right repo
local distant_url="$(bzr info $url 2> /dev/null | sed -n '/branch root/{s/ branch root: //p;q;}')"
local local_url="$(bzr config parent_location -d $dir)"
if [[ -n $distant_url ]]; then
if [[ $distant_url != "$local_url" ]]; then
error "$(gettext "%s is not a branch of %s")" "$dir" "$url"
plain "$(gettext "Aborting...")"
exit 1
fi
else
if [[ $url != "$local_url" ]] ; then
error "$(gettext "%s is not a branch of %s")" "$dir" "$url"
error "$(gettext "The local URL is %s")" "$local_url"
plain "$(gettext "Aborting...")"
exit 1
fi
fi
msg2 "$(gettext "Pulling %s ...")" "${displaylocation}"
cd_safe "$dir"
if ! bzr pull "$url"; then