mirror of
https://github.com/moparisthebest/pacman
synced 2024-08-13 17:03:46 -04:00
Add support for all bzr URLs in the PKGBUILD source array
Add support for all bzr URLs, including "lp:" URLs, in the source array. This, however, requires an internet connection and will fall back to the current behavior for offline builds. In that case, only the URL reported by 'bzr config parent_location' run inside the local repo can be used, and is outputted. Signed-off-by: Maxime Gauduin <alucryd@gmail.com>
This commit is contained in:
parent
b7c994db8b
commit
2bf2700b74
@ -245,6 +245,9 @@ get_filename() {
|
|||||||
filename=${netfile%%#*}
|
filename=${netfile%%#*}
|
||||||
filename=${filename%/}
|
filename=${filename%/}
|
||||||
filename=${filename##*/}
|
filename=${filename##*/}
|
||||||
|
if [[ $proto = bzr* ]]; then
|
||||||
|
filename=${filename#*lp:}
|
||||||
|
fi
|
||||||
if [[ $proto = git* ]]; then
|
if [[ $proto = git* ]]; then
|
||||||
filename=${filename%%.git*}
|
filename=${filename%%.git*}
|
||||||
fi
|
fi
|
||||||
@ -269,6 +272,9 @@ get_protocol() {
|
|||||||
# strip leading filename
|
# strip leading filename
|
||||||
local proto="${1##*::}"
|
local proto="${1##*::}"
|
||||||
printf "%s\n" "${proto%%://*}"
|
printf "%s\n" "${proto%%://*}"
|
||||||
|
elif [[ $1 = *lp:* ]]; then
|
||||||
|
local proto="${1##*::}"
|
||||||
|
printf "%s\n" "${proto%%lp:*}"
|
||||||
else
|
else
|
||||||
printf "%s\n" local
|
printf "%s\n" local
|
||||||
fi
|
fi
|
||||||
@ -471,10 +477,21 @@ download_bzr() {
|
|||||||
fi
|
fi
|
||||||
elif (( ! HOLDVER )); then
|
elif (( ! HOLDVER )); then
|
||||||
# Make sure we are fetching the right repo
|
# Make sure we are fetching the right repo
|
||||||
if [[ "$url" != "$(bzr config parent_location -d $dir)" ]] ; then
|
local distant_url="$(bzr info $url 2> /dev/null | sed -n '/branch root/{s/ branch root: //p;q;}')"
|
||||||
error "$(gettext "%s is not a branch of %s")" "$dir" "$url"
|
local local_url="$(bzr config parent_location -d $dir)"
|
||||||
plain "$(gettext "Aborting...")"
|
if [[ -n $distant_url ]]; then
|
||||||
exit 1
|
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
|
fi
|
||||||
msg2 "$(gettext "Pulling %s ...")" "${displaylocation}"
|
msg2 "$(gettext "Pulling %s ...")" "${displaylocation}"
|
||||||
cd_safe "$dir"
|
cd_safe "$dir"
|
||||||
|
Loading…
Reference in New Issue
Block a user