[pacman-dev] [PATCH 1/3] paccache: exit in case of pacman error when -u flag is used
From: Dario Giovannetti <dariogiova@gmail.com> Fixes https://bugs.archlinux.org/task/43286 Signed-off-by: Dario Giovannetti <dariogiova@gmail.com> --- contrib/paccache.sh.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/contrib/paccache.sh.in b/contrib/paccache.sh.in index 6a68d4d..1690583 100644 --- a/contrib/paccache.sh.in +++ b/contrib/paccache.sh.in @@ -256,6 +256,8 @@ while :; do delete=1 ;; -u|--uninstalled) IFS=$'\n' read -r -d '' -a ign < <(pacman -Qq) + # pacman -Qq may exit with an error, thus making ign an empty array + (( ${#ign[@]} )) || die 'failed to retrieve the list of installed packages' blacklist+=("${ign[@]}") unset ign ;; -V|--version) -- 2.2.1
I suspect this is just wrong -- you never need to quote the replacement side of a PE. In bash 4.3, this is essentially a no-op, but because of a bug in bash 4.2, we get embedded quotes as a result of this replacement. The relevant changelog item in bash is: Fixed a bug that caused single quotes that resulted from $'...' quoting in the replacement portion of a double-quoted ${word/pat/rep} expansion to be treated as quote characters. But this doesn't apply to us. Let's just drop the excessive quoting... --- scripts/makepkg.sh.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 880e778..e032e26 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -362,11 +362,11 @@ download_file() { # replace %o by the temporary dlfile if it exists if [[ ${cmdline[*]} = *%o* ]]; then dlfile=$filename.part - cmdline=("${cmdline[@]//%o/"$dlfile"}") + cmdline=("${cmdline[@]//%o/$dlfile}") fi # add the URL, either in place of %u or at the end if [[ ${cmdline[*]} = *%u* ]]; then - cmdline=("${cmdline[@]//%u/"$url"}") + cmdline=("${cmdline[@]//%u/$url}") else cmdline+=("$url") fi -- 2.2.1
acc639adf20d removed this, but shouldn't have. --- Allan, any idea why you removed this? I infer from the commit message that the patch was about SRCINFO only, and had nothing to do with PKGINFO. scripts/makepkg.sh.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index e032e26..7093dcd 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -2140,6 +2140,8 @@ write_pkginfo() { local size="$(@DUPATH@ @DUFLAGS@)" size="$(( ${size%%[^0-9]*} * 1024 ))" + merge_arch_attrs + msg2 "$(gettext "Generating %s file...")" ".PKGINFO" printf "# Generated by makepkg %s\n" "$makepkg_version" printf "# using %s\n" "$(fakeroot -v)" -- 2.2.1
On 10/01/15 06:52, Dave Reisner wrote:
acc639adf20d removed this, but shouldn't have. --- Allan, any idea why you removed this? I infer from the commit message that the patch was about SRCINFO only, and had nothing to do with PKGINFO.
It is done when the PKGBUILD is sourced: source_buildfile() { source_safe "$@" if (( !SOURCEONLY )); then merge_arch_attrs fi }
scripts/makepkg.sh.in | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index e032e26..7093dcd 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -2140,6 +2140,8 @@ write_pkginfo() { local size="$(@DUPATH@ @DUFLAGS@)" size="$(( ${size%%[^0-9]*} * 1024 ))"
+ merge_arch_attrs + msg2 "$(gettext "Generating %s file...")" ".PKGINFO" printf "# Generated by makepkg %s\n" "$makepkg_version" printf "# using %s\n" "$(fakeroot -v)"
On 10/01/15 10:08, Allan McRae wrote:
On 10/01/15 06:52, Dave Reisner wrote:
acc639adf20d removed this, but shouldn't have. --- Allan, any idea why you removed this? I infer from the commit message that the patch was about SRCINFO only, and had nothing to do with PKGINFO.
It is done when the PKGBUILD is sourced:
source_buildfile() { source_safe "$@"
if (( !SOURCEONLY )); then merge_arch_attrs fi }
We figured out the issue is with split packages and the arrays in the package_foo() functions. A
participants (2)
-
Allan McRae
-
Dave Reisner