SHARE
TWEET

Trust Developers and TU for arch repos

ATuin Jan 7th, 2012 81 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/sh
  2.  
  3. ####
  4. ## Little script to trust developer and TU keys from arch team. Needed for pacman 4
  5. ## Usefull if you plan to use that feature.
  6. ##
  7. ## Aitor ATuin
  8. ##
  9. ## Use at your own risk :)
  10. ###
  11.  
  12.  
  13. function trust () {
  14.     url=$1
  15.     for key in `curl $url 2>/dev/null| awk -F'<' '$0 ~ />0x/ {sub(/^.+>0x/,"",$3);print($3)}'`; do
  16.         /usr/bin/pacman-key --recv-keys $key
  17.         /usr/bin/pacman-key --lsign-key $key
  18.         printf 'trust\n3\nquit\n' | gpg --homedir /etc/pacman.d/gnupg --no-permission-warning --command-fd 0 --edit-key $key
  19.     done
  20.  
  21. }
  22.  
  23. BASEURL="https://www.archlinux.org"
  24. for url in `echo developers trustedusers`; do
  25.     trust ${BASEURL}/${url}/
  26. done
RAW Paste Data
Top