paclist: list packages which version differs from the repo version

Message ID 20181205212524.13421-1-michael.straube@posteo.de
State Superseded, archived
Headers show
Series
  • paclist: list packages which version differs from the repo version
Related show

Commit Message

Michael Straube Dec. 5, 2018, 9:25 p.m. UTC
Paclist does not list installed packages if the version is different
from the version in the repository. Change the awk command to also
match such packages from the 'pacman -Sl' output.

Fixes FS#60412

Signed-off-by: Michael Straube <michael.straube@posteo.de>
---
 src/paclist.sh.in | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

Patch

diff --git a/src/paclist.sh.in b/src/paclist.sh.in
index f827dcf..2e2146c 100644
--- a/src/paclist.sh.in
+++ b/src/paclist.sh.in
@@ -23,13 +23,6 @@  declare -r myver='@PACKAGE_VERSION@'
 export TEXTDOMAIN='pacman'
 export TEXTDOMAINDIR='/usr/share/locale'
 
-# determine whether we have gettext; make it a no-op if we do not
-if ! type gettext &>/dev/null; then
-	gettext() {
-		echo "$@"
-	}
-fi
-
 usage() {
 	printf "%s v%s\n" "${myname}" "${myver}"
 	echo
@@ -59,8 +52,8 @@  elif [[ $1 = -@(V|-version) ]]; then
 	exit 0
 fi
 
-printf -v installed '[%s]' "$(gettext installed)"
-pacman -Sl $1 | awk -v i="$installed" '$NF == i { print $2,$3 }'
+pacman -Sl $1 | awk 'NF == 4 { print $2,$3 };
+                     NF == 5 { print $2,substr($5, 1, length($5) - 1) }'
 
 # exit with pacman's return value, not awk's
 exit ${PIPESTATUS[0]}