Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/scripts/makepkg.sh.in
diff options
context:
space:
mode:
authorLukáš Jirkovský <l.jirkovsky@gmail.com>2013-12-09 21:31:22 +0100
committerAllan McRae <allan@archlinux.org>2014-11-09 18:28:47 +1000
commitbe3ce88bb21cc62a3788a7aca6322a312f6b87d7 (patch)
tree3e48ee25924dde3a81351a49e875e9b9b2259157 /scripts/makepkg.sh.in
parentf66ae5334eb1b5b816346cc3e69d01cf5e7fe306 (diff)
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>
Diffstat (limited to 'scripts/makepkg.sh.in')
-rw-r--r--scripts/makepkg.sh.in14
1 files changed, 10 insertions, 4 deletions
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index af61ee71..e0cd2e4f 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -671,13 +671,12 @@ extract_hg() {
msg2 "$(gettext "Creating working copy of %s %s repo...")" "${repo}" "hg"
pushd "$srcdir" &>/dev/null
- rm -rf "${dir##*/}"
- local ref
+ local ref=tip
if [[ -n $fragment ]]; then
case ${fragment%%=*} in
branch|revision|tag)
- ref=('-u' "${fragment##*=}")
+ ref="${fragment##*=}"
;;
*)
error "$(gettext "Unrecognized reference: %s")" "${fragment}"
@@ -686,7 +685,14 @@ extract_hg() {
esac
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"
plain "$(gettext "Aborting...")"
exit 1