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