From 71ae0b024db0a9833086b60a71c57a74fb2c85c4 Mon Sep 17 00:00:00 2001 From: David Runge Date: Sun, 1 May 2022 15:48:02 +0200 Subject: zsh: Make pkg_keyid_lookup() more robust .config/zsh/includes/functions.zsh: Change pkg_keyid_lookup() to work on blocks of data to become more robust in detecting packages signed by a specific packager. --- .config/zsh/includes/functions.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.config/zsh') diff --git a/.config/zsh/includes/functions.zsh b/.config/zsh/includes/functions.zsh index 6f08e59..afe4915 100644 --- a/.config/zsh/includes/functions.zsh +++ b/.config/zsh/includes/functions.zsh @@ -410,6 +410,6 @@ function pkg_keyid_lookup() { return 1 fi - pacman -Sii | grep $key_id -B20 | grep Name |awk '{print $(NF)}' + pacman -Sii | awk -v signature=$key_id 'BEGIN {RS=""; FS="\n"} {if ($0 ~ signature && $2 ~ /Name/) {split($2, m, ":"); gsub(/ /, "", m[2]); print m[2]}}' } # FUNCTIONS > -- cgit v1.2.3-70-g09d2