e47708599394f354ce9c3e055bfdae16888fa546

Author
Robby Russell <robby@planetargon.com>
Committer
Robby Russell <robby@planetargon.com>
Date

Message

Merge pull request #1456 from sputnikus/master

Function for managing pacman-key command on Arch Linux

Diff

 1diff --git a/plugins/archlinux/archlinux.plugin.zsh b/plugins/archlinux/archlinux.plugin.zsh
 2index 294dc5354cce12627ab52e0d0d69f45ec9859131..ae92a0b4c5913ee7b7074f48b9cb283b5c437992 100644
 3--- a/plugins/archlinux/archlinux.plugin.zsh
 4+++ b/plugins/archlinux/archlinux.plugin.zsh
 5@@ -11,7 +11,7 @@ if [[ -x `which yaourt` ]]; then
 6   alias yaupg='yaourt -Syu'        # Synchronize with repositories before upgrading packages that are out of date on the local system.
 7   alias yasu='yaourt --sucre'      # Same as yaupg, but without confirmation
 8   alias yain='yaourt -S'           # Install specific package(s) from the repositories
 9-  alias yains='yaourt -U'          # Install specific package not from the repositories but from a file 
10+  alias yains='yaourt -U'          # Install specific package not from the repositories but from a file
11   alias yare='yaourt -R'           # Remove the specified package(s), retaining its configuration(s) and required dependencies
12   alias yarem='yaourt -Rns'        # Remove the specified package(s), its configuration(s) and unneeded dependencies
13   alias yarep='yaourt -Si'         # Display information about a given package in the repositories
14@@ -35,7 +35,7 @@ fi
15 # Pacman - https://wiki.archlinux.org/index.php/Pacman_Tips
16 alias pacupg='sudo pacman -Syu'        # Synchronize with repositories before upgrading packages that are out of date on the local system.
17 alias pacin='sudo pacman -S'           # Install specific package(s) from the repositories
18-alias pacins='sudo pacman -U'          # Install specific package not from the repositories but from a file 
19+alias pacins='sudo pacman -U'          # Install specific package not from the repositories but from a file
20 alias pacre='sudo pacman -R'           # Remove the specified package(s), retaining its configuration(s) and required dependencies
21 alias pacrem='sudo pacman -Rns'        # Remove the specified package(s), its configuration(s) and unneeded dependencies
22 alias pacrep='pacman -Si'              # Display information about a given package in the repositories
23@@ -75,3 +75,19 @@ pacdisowned() {
24 
25   comm -23 "$fs" "$db"
26 }
27+
28+pacmanallkeys() {
29+  # Get all keys for developers and trusted users
30+  curl https://www.archlinux.org/{developers,trustedusers}/ |
31+  awk -F\" '(/pgp.mit.edu/) {sub(/.*search=0x/,"");print $1}' |
32+  xargs sudo pacman-key --recv-keys
33+}
34+
35+pacmansignkeys() {
36+  for key in $*; do
37+    sudo pacman-key --recv-keys $key
38+    sudo pacman-key --lsign-key $key
39+    printf 'trust\n3\n' | sudo gpg --homedir /etc/pacman.d/gnupg \
40+      --no-permission-warning --command-fd 0 --edit-key $key
41+  done
42+}