diff options
author | David Runge <dave@sleepmap.de> | 2022-05-01 15:48:02 +0200 |
---|---|---|
committer | David Runge <dave@sleepmap.de> | 2022-05-01 16:18:15 +0200 |
commit | 71ae0b024db0a9833086b60a71c57a74fb2c85c4 (patch) | |
tree | 01b18f9185cf19bf853e7b089cd276514425b1b9 | |
parent | 2f4d5163d2d1e4ad135d0cf121fcef641d2916f4 (diff) | |
download | dotfiles-71ae0b024db0a9833086b60a71c57a74fb2c85c4.tar.gz dotfiles-71ae0b024db0a9833086b60a71c57a74fb2c85c4.tar.bz2 dotfiles-71ae0b024db0a9833086b60a71c57a74fb2c85c4.tar.xz dotfiles-71ae0b024db0a9833086b60a71c57a74fb2c85c4.zip |
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.
-rw-r--r-- | .config/zsh/includes/functions.zsh | 2 |
1 files changed, 1 insertions, 1 deletions
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 > |