You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ppkgbuild 513B

1234567891011121314151617181920
  1. #!/usr/bin/env bash
  2. #
  3. # pbrisbin 2013 - print the PKGBUILD for any package, official or AUR.
  4. #
  5. ###
  6. enabled_repos() { sed '/^\[\(.*\)\]$/!d; s//\1/g; /options/d' /etc/pacman.conf; }
  7. (( $# )) || { printf "usage: ppkgbuild <package>\n" >&2; exit 1; }
  8. for repo in $(enabled_repos); do
  9. dir="/var/abs/$repo/$1"
  10. if [[ -d "$dir" ]]; then
  11. find "$dir" -name PKGBUILD -exec cat {} \;
  12. exit 0
  13. fi
  14. done
  15. # not getting crazy with escaping, deal.
  16. curl -s "https://aur.archlinux.org/packages/${1:0:2}/$1/PKGBUILD"