diff options
author | Allan McRae <allan@archlinux.org> | 2013-05-29 06:02:56 +0200 |
---|---|---|
committer | Allan McRae <allan@archlinux.org> | 2013-05-29 06:02:56 +0200 |
commit | 84ac55b0529b6489da38ebfc56a988228aa4859a (patch) | |
tree | 66667e127a6509af1b701bf2077d023e55b04f44 /scripts | |
parent | 0f988beff8794338485352dc1beafbfcdbb20db1 (diff) | |
parent | 7d2c7fb347e8b5ea89127f3f8b4a545772394600 (diff) | |
download | pacman-84ac55b0529b6489da38ebfc56a988228aa4859a.tar.gz pacman-84ac55b0529b6489da38ebfc56a988228aa4859a.tar.xz |
Merge branch 'maint'
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/makepkg.sh.in | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index b85b87e5..a59e13e5 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -448,29 +448,14 @@ download_bzr() { url=${url%%#*} local repo=$(get_filename "$netfile") - local displaylocation="$url" - local revision=('-r-1') - - if [[ -n $fragment ]]; then - case ${fragment%%=*} in - revision) - revision=("-r${fragment##*=}") - displaylocation="$url -r ${fragment##*=}" - ;; - *) - error "$(gettext "Unrecognized reference: %s")" "${fragment}" - plain "$(gettext "Aborting...")" - exit 1 - esac - fi local dir=$(get_filepath "$netfile") [[ -z "$dir" ]] && dir="$SRCDEST/$(get_filename "$netfile")" if [[ ! -d "$dir" ]] || dir_is_empty "$dir" ; then msg2 "$(gettext "Branching %s ...")" "${displaylocation}" - if ! bzr branch "$url" "$dir" ${revision[@]} --no-tree --use-existing-dir; then + if ! bzr branch "$url" "$dir" --no-tree --use-existing-dir; then error "$(gettext "Failure while branching %s")" "${displaylocation}" plain "$(gettext "Aborting...")" exit 1 @@ -495,7 +480,7 @@ download_bzr() { fi msg2 "$(gettext "Pulling %s ...")" "${displaylocation}" cd_safe "$dir" - if ! bzr pull "$url" ${revision[@]} --overwrite; then + if ! bzr pull "$url" --overwrite; then # only warn on failure to allow offline builds warning "$(gettext "Failure while pulling %s")" "${displaylocation}" fi @@ -505,11 +490,25 @@ download_bzr() { extract_bzr() { local netfile=$1 + local repo=$(get_filename "$netfile") local fragment=${netfile#*#} if [[ $fragment = "$netfile" ]]; then unset fragment fi + if [[ -n $fragment ]]; then + case ${fragment%%=*} in + revision) + revision=("-r" "${fragment#*=}") + displaylocation="$url -r ${fragment#*=}" + ;; + *) + error "$(gettext "Unrecognized reference: %s")" "${fragment}" + plain "$(gettext "Aborting...")" + exit 1 + esac + fi + local dir=$(get_filepath "$netfile") [[ -z "$dir" ]] && dir="$SRCDEST/$(get_filename "$netfile")" @@ -517,7 +516,8 @@ extract_bzr() { pushd "$srcdir" &>/dev/null rm -rf "${dir##*/}" - if ! bzr checkout "$dir" --lightweight; then + if ! { bzr checkout "$dir" "${revision[@]}" --lightweight && + ( cd "$repo" && bzr pull "$dir" -q --overwrite "${revision[@]}" ); }; then error "$(gettext "Failure while creating working copy of %s %s repo")" "${repo}" "bzr" plain "$(gettext "Aborting...")" exit 1 @@ -1463,7 +1463,7 @@ run_function() { fi # ensure overridden package variables survive tee with split packages - logpipe=$(mktemp -u "$startdir/logpipe.XXXXXXXX") + logpipe=$(mktemp -u "$LOGDEST/logpipe.XXXXXXXX") mkfifo "$logpipe" tee "$BUILDLOG" < "$logpipe" & local teepid=$! |