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:
authorAllan McRae <allan@archlinux.org>2013-05-07 12:59:44 +1000
committerAllan McRae <allan@archlinux.org>2013-05-07 12:59:44 +1000
commit0f988beff8794338485352dc1beafbfcdbb20db1 (patch)
treee673c51058bddede4ef7f054e79c8ae799809628 /scripts/makepkg.sh.in
parentc5716d0e72e47c8cd2ca1a437598eeee54111754 (diff)
parenta4a7336dff8155cfeb37341d1e9e56092439bae6 (diff)
Merge branch 'maint'
Diffstat (limited to 'scripts/makepkg.sh.in')
-rw-r--r--scripts/makepkg.sh.in45
1 files changed, 34 insertions, 11 deletions
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index edfca3cb..b85b87e5 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -245,6 +245,9 @@ get_filename() {
filename=${netfile%%#*}
filename=${filename%/}
filename=${filename##*/}
+ if [[ $proto = bzr* ]]; then
+ filename=${filename#*lp:}
+ fi
if [[ $proto = git* ]]; then
filename=${filename%%.git*}
fi
@@ -269,6 +272,9 @@ get_protocol() {
# strip leading filename
local proto="${1##*::}"
printf "%s\n" "${proto%%://*}"
+ elif [[ $1 = *lp:* ]]; then
+ local proto="${1##*::}"
+ printf "%s\n" "${proto%%lp:*}"
else
printf "%s\n" local
fi
@@ -471,10 +477,21 @@ download_bzr() {
fi
elif (( ! HOLDVER )); then
# Make sure we are fetching the right repo
- if [[ "$url" != "$(bzr config parent_location -d $dir)" ]] ; then
- error "$(gettext "%s is not a branch of %s")" "$dir" "$url"
- plain "$(gettext "Aborting...")"
- exit 1
+ local distant_url="$(bzr info $url 2> /dev/null | sed -n '/branch root/{s/ branch root: //p;q;}')"
+ local local_url="$(bzr config parent_location -d $dir)"
+ if [[ -n $distant_url ]]; then
+ 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
msg2 "$(gettext "Pulling %s ...")" "${displaylocation}"
cd_safe "$dir"
@@ -688,7 +705,8 @@ download_svn() {
if [[ ! -d "$dir" ]] || dir_is_empty "$dir" ; then
msg2 "$(gettext "Cloning %s %s repo...")" "${repo}" "svn"
- if ! svn checkout --config-dir "$dir" "$url" "$dir"; then
+ mkdir -p "$dir/.makepkg"
+ if ! svn checkout --config-dir "$dir/.makepkg" "$url" "$dir"; then
error "$(gettext "Failure while downloading %s %s repo")" "${repo}" "svn"
plain "$(gettext "Aborting...")"
exit 1
@@ -725,7 +743,7 @@ extract_svn() {
if [[ -n $fragment ]]; then
case ${fragment%%=*} in
revision)
- ref=('-r' "${fragment##*=}")
+ ref="${fragment##*=}"
;;
*)
error "$(gettext "Unrecognized reference: %s")" "${fragment}"
@@ -734,9 +752,14 @@ extract_svn() {
esac
fi
- if ! svn export ${ref[@]} "$dir"; then
- error "$(gettext "Failure while creating working copy of %s %s repo")" "${repo}" "svn"
- plain "$(gettext "Aborting...")"
+ cp -a "$dir" .
+
+ if [[ -n ${ref} ]]; then
+ cd_safe "$(get_filename "$netfile")"
+ if ! svn update -r ${ref}; then
+ error "$(gettext "Failure while creating working copy of %s %s repo")" "${repo}" "svn"
+ plain "$(gettext "Aborting...")"
+ fi
fi
popd &>/dev/null
@@ -1356,7 +1379,6 @@ error_function() {
if (( ! BASH_SUBSHELL )); then
error "$(gettext "A failure occurred in %s().")" "$1"
plain "$(gettext "Aborting...")"
- remove_deps
fi
exit 2 # $E_BUILD_FAILED
}
@@ -1451,7 +1473,7 @@ run_function() {
wait $teepid
rm "$logpipe"
else
- $pkgfunc 2>&1
+ "$pkgfunc"
fi
# reset our shell options
eval "$shellopts"
@@ -2475,6 +2497,7 @@ usage() {
printf -- "$(gettext " -R, --repackage Repackage contents of the package without rebuilding")\n"
printf -- "$(gettext " -s, --syncdeps Install missing dependencies with %s")\n" "pacman"
printf -- "$(gettext " -S, --source Generate a source-only tarball without downloaded sources")\n"
+ printf -- "$(gettext " -V, --version Show version information and exit")\n"
printf -- "$(gettext " --allsource Generate a source-only tarball including downloaded sources")\n"
printf -- "$(gettext " --verifysource Download source files (if needed) and perform integrity checks")\n"
printf -- "$(gettext " --asroot Allow %s to run as root user")\n" "makepkg"