diff options
Diffstat (limited to '.config/zsh')
-rw-r--r-- | .config/zsh/includes/functions.zsh | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/.config/zsh/includes/functions.zsh b/.config/zsh/includes/functions.zsh index 7a87bee..6f08e59 100644 --- a/.config/zsh/includes/functions.zsh +++ b/.config/zsh/includes/functions.zsh @@ -395,4 +395,21 @@ function pasters() { curl --data-binary @"${file}" https://paste.rs } +function pkg_keyid_lookup() { + # lookup all packages signed by a given PGP key ID (either 16 or 40 chars long) + local key_id="$1" + local key_id_length=${#key_id} + + if (( $key_id_length == 40 )); then + key_id=${key_id[25,40]} + key_id_length=${#key_id} + fi + + if (( $key_id_length != 16 )); then + printf "Key ID is not 40 or 16 chars long: %s\n" $key_id + return 1 + fi + + pacman -Sii | grep $key_id -B20 | grep Name |awk '{print $(NF)}' +} # FUNCTIONS > |