mirror of
https://github.com/moparisthebest/pacman
synced 2024-08-13 17:03:46 -04:00
makepkg: bzr: update existing sources in srcdir without removing them first.
The local changes are discarded when updating. This matches the behaviour when non-VCS sources are used. It also allows incremental builds. This also changes the checkout during bzr source "extraction" to a heavyweight checkout so that pulling a specific revision does not alter the original download. Original-work-by: Lukáš Jirkovský <l.jirkovsky@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
be3ce88bb2
commit
db2562113b
@ -482,7 +482,7 @@ download_bzr() {
|
|||||||
fi
|
fi
|
||||||
msg2 "$(gettext "Pulling %s ...")" "${displaylocation}"
|
msg2 "$(gettext "Pulling %s ...")" "${displaylocation}"
|
||||||
cd_safe "$dir"
|
cd_safe "$dir"
|
||||||
if ! bzr pull "$url" --overwrite; then
|
if ! bzr pull "$url"; then
|
||||||
# only warn on failure to allow offline builds
|
# only warn on failure to allow offline builds
|
||||||
warning "$(gettext "Failure while pulling %s")" "${displaylocation}"
|
warning "$(gettext "Failure while pulling %s")" "${displaylocation}"
|
||||||
fi
|
fi
|
||||||
@ -498,10 +498,11 @@ extract_bzr() {
|
|||||||
unset fragment
|
unset fragment
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
rev="last:1"
|
||||||
if [[ -n $fragment ]]; then
|
if [[ -n $fragment ]]; then
|
||||||
case ${fragment%%=*} in
|
case ${fragment%%=*} in
|
||||||
revision)
|
revision)
|
||||||
revision=("-r" "${fragment#*=}")
|
rev="${fragment#*=}"
|
||||||
displaylocation="$url -r ${fragment#*=}"
|
displaylocation="$url -r ${fragment#*=}"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
@ -516,10 +517,15 @@ extract_bzr() {
|
|||||||
|
|
||||||
msg2 "$(gettext "Creating working copy of %s %s repo...")" "${repo}" "bzr"
|
msg2 "$(gettext "Creating working copy of %s %s repo...")" "${repo}" "bzr"
|
||||||
pushd "$srcdir" &>/dev/null
|
pushd "$srcdir" &>/dev/null
|
||||||
rm -rf "${dir##*/}"
|
|
||||||
|
|
||||||
if ! { bzr checkout "$dir" "${revision[@]}" --lightweight &&
|
if [[ -d "${dir##*/}" ]]; then
|
||||||
( cd "$repo" && bzr pull "$dir" -q --overwrite "${revision[@]}" ); }; then
|
cd_safe "${dir##*/}"
|
||||||
|
if ! (bzr pull "$dir" -q --overwrite -r "$rev" && bzr clean-tree -q --detritus --force); then
|
||||||
|
error "$(gettext "Failure while updating working copy of %s %s repo")" "${repo}" "bzr"
|
||||||
|
plain "$(gettext "Aborting...")"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
elif ! bzr checkout "$dir" -r "$rev"; then
|
||||||
error "$(gettext "Failure while creating working copy of %s %s repo")" "${repo}" "bzr"
|
error "$(gettext "Failure while creating working copy of %s %s repo")" "${repo}" "bzr"
|
||||||
plain "$(gettext "Aborting...")"
|
plain "$(gettext "Aborting...")"
|
||||||
exit 1
|
exit 1
|
||||||
|
Loading…
Reference in New Issue
Block a user