From b7c994db8b049b87df5ec5d6cada84a36c60c47d Mon Sep 17 00:00:00 2001 From: William Giokas <1007380@gmail.com> Date: Fri, 15 Mar 2013 12:11:11 -0500 Subject: makepkg: don't run remove_deps twice when unneeded remove_deps already has a check and won't run unless -r is specified, so if this was meant to remove dependencies of a failure no matter what, then it's not doing it, and with -r it is run twice on a failure for no real reason. Signed-off-by: William Giokas <1007380@gmail.com> Signed-off-by: Allan McRae --- scripts/makepkg.sh.in | 1 - 1 file changed, 1 deletion(-) (limited to 'scripts/makepkg.sh.in') diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index da620a45..c2f89c97 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -1356,7 +1356,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 } -- cgit v1.2.3-24-g4f1b From 2bf2700b744392ab3fb4e5295e3a2619b1ddfe28 Mon Sep 17 00:00:00 2001 From: Maxime Gauduin Date: Wed, 10 Apr 2013 18:54:02 +0200 Subject: Add support for all bzr URLs in the PKGBUILD source array Add support for all bzr URLs, including "lp:" URLs, in the source array. This, however, requires an internet connection and will fall back to the current behavior for offline builds. In that case, only the URL reported by 'bzr config parent_location' run inside the local repo can be used, and is outputted. Signed-off-by: Maxime Gauduin --- scripts/makepkg.sh.in | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'scripts/makepkg.sh.in') diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index c2f89c97..67ee22a6 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" -- cgit v1.2.3-24-g4f1b From 7e0f528274478e7d3057d71717596fdaa5e5bb79 Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Thu, 11 Apr 2013 11:56:06 +1000 Subject: Do not use checkout directory for SVN config Using the checkout directory for the SVN config can result in clashes between config files and files from the SVN checkout. Instead, use a ".makepkg" directory within the checkout. Signed-off-by: Allan McRae --- scripts/makepkg.sh.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'scripts/makepkg.sh.in') diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 67ee22a6..4d9176a2 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -705,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 -- cgit v1.2.3-24-g4f1b From 695f0e443e18ca5d7b722bdf2c4695cc63c1af54 Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Thu, 11 Apr 2013 15:46:51 +1000 Subject: makepkg: fix svn repo extraction Copy SVN repos rather than using "svn export" to keep all anotation files in the repo for build scripts that use (e.g.) "svin info". Signed-off-by: Allan McRae --- scripts/makepkg.sh.in | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'scripts/makepkg.sh.in') diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 4d9176a2..dfc40772 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -743,7 +743,7 @@ extract_svn() { if [[ -n $fragment ]]; then case ${fragment%%=*} in revision) - ref=('-r' "${fragment##*=}") + ref="${fragment##*=}" ;; *) error "$(gettext "Unrecognized reference: %s")" "${fragment}" @@ -752,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 -- cgit v1.2.3-24-g4f1b From c5a4b35528452855d125cea749fcc4a3a01fca9b Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Fri, 26 Apr 2013 20:32:37 -0400 Subject: makepkg: avoid redirecting stdout If stdout is already redirected, redirecting stderr to stdout can lead to undesirable results. Fixes FS#34974. Signed-off-by: Dave Reisner Signed-off-by: Allan McRae --- scripts/makepkg.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts/makepkg.sh.in') diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index dfc40772..deddade4 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -1473,7 +1473,7 @@ run_function() { wait $teepid rm "$logpipe" else - $pkgfunc 2>&1 + "$pkgfunc" fi # reset our shell options eval "$shellopts" -- cgit v1.2.3-24-g4f1b From 91b9ea922ae3db12cbff570718709d4c836c4cbf Mon Sep 17 00:00:00 2001 From: Eric Bélanger Date: Sun, 28 Apr 2013 21:49:01 -0400 Subject: Add -V/--version option to makepkg's usage function and man page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Eric Bélanger Signed-off-by: Allan McRae --- scripts/makepkg.sh.in | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts/makepkg.sh.in') diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index deddade4..75ddfe54 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -2497,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" -- cgit v1.2.3-24-g4f1b