mirror of
https://github.com/moparisthebest/pacman
synced 2024-08-13 17:03:46 -04:00
makepkg: hg: 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. Signed-off-by: Lukáš Jirkovský <l.jirkovsky@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
f66ae5334e
commit
be3ce88bb2
@ -671,13 +671,12 @@ extract_hg() {
|
|||||||
|
|
||||||
msg2 "$(gettext "Creating working copy of %s %s repo...")" "${repo}" "hg"
|
msg2 "$(gettext "Creating working copy of %s %s repo...")" "${repo}" "hg"
|
||||||
pushd "$srcdir" &>/dev/null
|
pushd "$srcdir" &>/dev/null
|
||||||
rm -rf "${dir##*/}"
|
|
||||||
|
|
||||||
local ref
|
local ref=tip
|
||||||
if [[ -n $fragment ]]; then
|
if [[ -n $fragment ]]; then
|
||||||
case ${fragment%%=*} in
|
case ${fragment%%=*} in
|
||||||
branch|revision|tag)
|
branch|revision|tag)
|
||||||
ref=('-u' "${fragment##*=}")
|
ref="${fragment##*=}"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
error "$(gettext "Unrecognized reference: %s")" "${fragment}"
|
error "$(gettext "Unrecognized reference: %s")" "${fragment}"
|
||||||
@ -686,7 +685,14 @@ extract_hg() {
|
|||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! hg clone "${ref[@]}" "$dir" "${dir##*/}"; then
|
if [[ -d "${dir##*/}" ]]; then
|
||||||
|
cd_safe "${dir##*/}"
|
||||||
|
if ! (hg pull && hg update -C -r "$ref"); then
|
||||||
|
error "$(gettext "Failure while updating working copy of %s %s repo")" "${repo}" "hg"
|
||||||
|
plain "$(gettext "Aborting...")"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
elif ! hg clone -u "$ref" "$dir" "${dir##*/}"; then
|
||||||
error "$(gettext "Failure while creating working copy of %s %s repo")" "${repo}" "hg"
|
error "$(gettext "Failure while creating working copy of %s %s repo")" "${repo}" "hg"
|
||||||
plain "$(gettext "Aborting...")"
|
plain "$(gettext "Aborting...")"
|
||||||
exit 1
|
exit 1
|
||||||
|
Loading…
Reference in New Issue
Block a user