paccache: proper quoting in [[ expression ]]

Always quote the right-hand side of expression when the == or != operator
is used, unless intended as a pattern.

Signed-off-by: lolilolicon <lolilolicon@gmail.com>
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
This commit is contained in:
lolilolicon 2011-09-29 10:45:22 +08:00 committed by Dan McGee
parent e0400fff96
commit 6bb5948025
1 changed files with 1 additions and 1 deletions

View File

@ -153,7 +153,7 @@ summarize() {
while read -r pkg; do
if (( verbose >= 3 )); then
[[ $pkg =~ $pkg_re ]] && name=${BASH_REMATCH[1]} arch=${BASH_REMATCH[2]}
if [[ -z $seen || $seenarch != $arch || $seen != $name ]]; then
if [[ -z $seen || $seenarch != "$arch" || $seen != "$name" ]]; then
printf '%s (%s):\n' "$name" "$arch"
fi
printf ' %s\n' "$pkg"