From 72c6d19d64a89a5ad0d162fc0bb6517ea80fc252 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Wed, 15 May 2013 09:58:42 -0400 Subject: [PATCH 1/7] makepkg: fixup broken revision and repo references bzr support "worked", but didn't handle any of the actual features we wanted with makepkg. This moves the revision specification to the proper place (extraction, rather than download), and fixes an additional broken reference to $repo which was never set. Fixes FS#35281. Signed-off-by: Dave Reisner Signed-off-by: Allan McRae --- scripts/makepkg.sh.in | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 75ddfe54..2379c5fe 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 From 8be08f7cae8257af6866febc9d2a57d8d8601a51 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Wed, 15 May 2013 09:58:43 -0400 Subject: [PATCH 2/7] Revert "paccache: avoid subshell in calling runcmd" su is terribad. In addition to reverting, this also removes support for privilege escalation via su. If you want to use paccache as root and fail to comprehend how much better sudo is than su, then run paccache directly via su. Fixes FS#35173. This reverts commit 597286eb258f841dfc00f65474138fc6192f0092. Signed-off-by: Dave Reisner Signed-off-by: Allan McRae --- contrib/paccache.sh.in | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/contrib/paccache.sh.in b/contrib/paccache.sh.in index 64c3c536..a9c6524f 100644 --- a/contrib/paccache.sh.in +++ b/contrib/paccache.sh.in @@ -109,8 +109,7 @@ runcmd() { if sudo -v &>/dev/null && sudo -l &>/dev/null; then sudo "$@" else - printf '%s ' 'root' - su -c "$(printf '%q ' "$@")" + die 'Unable to escalate privileges using sudo' fi else "$@" @@ -308,9 +307,9 @@ totalsaved=$(@SIZECMD@ "${candidates[@]}" | awk '{ sum += $1 } END { print sum } # crush. kill. destroy. (( verbose )) && cmdopts+=(-v) if (( delete )); then - runcmd xargs -0a <(printf '%s\0' "${candidates[@]}") rm "${cmdopts[@]}" + printf '%s\0' "${candidates[@]}" | runcmd xargs -0 rm "${cmdopts[@]}" elif (( move )); then - runcmd xargs -0a <(printf '%s\0' "${candidates[@]}") mv "${cmdopts[@]}" -t "$movedir" + printf '%s\0' "${candidates[@]}" | runcmd xargs -0 mv "${cmdopts[@]}" -t "$movedir" fi summarize "$pkgcount" "${candidates[@]}" From 090c4006d748e0ec50b74e974b4f1fa6f3d6c1ec Mon Sep 17 00:00:00 2001 From: William Giokas <1007380@gmail.com> Date: Wed, 15 May 2013 11:25:58 -0500 Subject: [PATCH 3/7] contrib: Remove harcoded /etc/pacman.conf Signed-off-by: William Giokas <1007380@gmail.com> Signed-off-by: Allan McRae --- contrib/checkupdates.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/checkupdates.sh.in b/contrib/checkupdates.sh.in index 9244d85a..b41dfa03 100644 --- a/contrib/checkupdates.sh.in +++ b/contrib/checkupdates.sh.in @@ -32,7 +32,7 @@ fi trap 'rm -f $CHECKUPDATE_DB/db.lck' INT TERM EXIT DBPath="${DBPath:-@localstatedir@/lib/pacman/}" -eval $(awk -F' *= *' '$1 ~ /DBPath/ { print $1 "=" $2 }' /etc/pacman.conf) +eval $(awk -F' *= *' '$1 ~ /DBPath/ { print $1 "=" $2 }' @sysconfdir@/pacman.conf) mkdir -p "$CHECKUPDATE_DB" ln -s "${DBPath}/local" "$CHECKUPDATE_DB" &> /dev/null From 1ed881fed31952c65f9606df5e265c36221974e9 Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Sat, 18 May 2013 22:43:12 +1000 Subject: [PATCH 4/7] Fix comment typo Signed-off-by: Allan McRae --- lib/libalpm/deps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c index 96c49a9f..6d43dd00 100644 --- a/lib/libalpm/deps.c +++ b/lib/libalpm/deps.c @@ -488,7 +488,7 @@ alpm_depend_t *_alpm_dep_dup(const alpm_depend_t *dep) /* These parameters are messy. We check if this package, given a list of * targets and a db is safe to remove. We do NOT remove it if it is in the - * target list, or if if the package was explicitly installed and + * target list, or if the package was explicitly installed and * include_explicit == 0 */ static int can_remove_package(alpm_db_t *db, alpm_pkg_t *pkg, alpm_list_t *targets, int include_explicit) From 8335e169a6f38c288db4249c3d272a9ced332580 Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Sat, 18 May 2013 23:11:41 +1000 Subject: [PATCH 5/7] makepkg: Use LOGDEST for logpipe If LOGDEST is set, we may not check that $startdir is writable. Store the log pipe in LOGDEST instead. Signed-off-by: Allan McRae --- scripts/makepkg.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 2379c5fe..08dcf4ce 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -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=$! From d235f541143026aa59d012d7083a41c43a622eeb Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Sun, 19 May 2013 22:53:06 +1000 Subject: [PATCH 6/7] Remove incorrect bug number from NEWS The wrong bug number is mentioned in commit 32327dc8 and this was perpetuated into the NEWS file. Signed-off-by: Allan McRae --- NEWS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 6fdb5d52..ec194074 100644 --- a/NEWS +++ b/NEWS @@ -29,7 +29,7 @@ VERSION DESCRIPTION (FS#28014) - configure shell for running install scriptlets (FS#20557) - make path to ldconfig configurable - - display repo in VerbosePkgLists output (FS#26334) + - display repo in VerbosePkgLists output - do not check file conflicts or diskspace with --dbonly (FS#25667) - UseDelta takes a ratio for the largest delta to use From 7d2c7fb347e8b5ea89127f3f8b4a545772394600 Mon Sep 17 00:00:00 2001 From: "Jason St. John" Date: Tue, 28 May 2013 15:58:00 +0200 Subject: [PATCH 7/7] Fix various typos in NEWS imporve -> improve diskspace -> disk space BTRFS -> Btrfs filelists -> file lists filesize -> file size Signed-off-by: Jason St. John Signed-off-by: Allan McRae --- NEWS | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/NEWS b/NEWS index ec194074..c2da46e4 100644 --- a/NEWS +++ b/NEWS @@ -5,7 +5,7 @@ VERSION DESCRIPTION - various translation fixes and updates (FS#34395, FS#34704, FS#34716, FS#35097) - makepkg: - - imporve SVN VCS PKGBUILD handling (FS#34675, FS#34636) + - improve SVN VCS PKGBUILD handling (FS#34675, FS#34636) - allow "lp:" URLs for BZR sources (FS#34650) - prevent pkgver() capturing stderr (FS#34974) - fix attempt to remove package twice on failure (FS#34672) @@ -30,7 +30,7 @@ VERSION DESCRIPTION - configure shell for running install scriptlets (FS#20557) - make path to ldconfig configurable - display repo in VerbosePkgLists output - - do not check file conflicts or diskspace with --dbonly + - do not check file conflicts or disk space with --dbonly (FS#25667) - UseDelta takes a ratio for the largest delta to use - track how installed packages were validated (FS#28040) @@ -94,14 +94,14 @@ VERSION DESCRIPTION - use full delta size as max download size (FS#28345) - improved handling and fix crash after failed downloads - fix key lookup when using gpg 2.X as GPG program - - match only full path components in diskspace checking - - skip diskspace checks when using --dbonly + - match only full path components in disk space checking + - skip disk space checks when using --dbonly - scripts: unset CDPATH bash variable in all scripts - makepkg: - fix syntax error in remove_deps (FS#28448) - small fixes related to multiple libdeps, parsing issues - exit via default handler in trap_exit (FS#28491) - - attempt to work around BTRFS file/block size reporting issues + - attempt to work around Btrfs file/block size reporting issues - pacman-key: - remove signature verification in --populate - make -e option work as advertised without arguments @@ -177,8 +177,8 @@ VERSION DESCRIPTION - split package verification and load stages - sync database reading refactor for performance - use a larger buffer for package checksum validation - - filelists now have a dedicated type with metadata - - diskspace check no longer requires iterating package archives + - file lists now have a dedicated type with metadata + - disk space check no longer requires iterating package archives - update and add checksum routines from PolarSSL - validate sync database sha256sum if available - correctly parse sizes in database > 2GiB @@ -240,7 +240,7 @@ VERSION DESCRIPTION - fix default path substitution in documentation - makepkg: quote variables that may contain spaces (FS#24002) - makepkg: fix creation of source package with -p (FS#24567) - - repo-add: include dotfiles in filelists (FS#24534) + - repo-add: include dotfiles in file lists (FS#24534) - minor translation updates: de, fi, fr, sk, zh_CN 3.5.2 - ensure we show correct missing dependency info (FS#23424) - pacman usage/--help updates (FS#23433, FS#23369) @@ -387,7 +387,7 @@ VERSION DESCRIPTION - translations: - zh_CN: fix positional parameter usage in makepkg (FS#16983) - el: fix Y/N response translation (FS#16568) -3.3.2 - fix infinite filesize download issue (FS#16359) +3.3.2 - fix infinite file size download issue (FS#16359) - fix bogus download size on TotalDownload - documentation updates - small translation updates @@ -658,7 +658,7 @@ VERSION DESCRIPTION - conflicts checking speedups and fixes - move lockfile location to inside the DB - remove gettext calls from DEBUG messages - - remove faulty diskspace checking + - remove faulty disk space checking - move functions out of alpm.c to where they belong - rewrite of file extraction code (FS#7484) - makepkg-specific changes: