Skip to content

Instantly share code, notes, and snippets.

@n8henrie
Last active August 29, 2015 14:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save n8henrie/591110cba073ab4fc0b1 to your computer and use it in GitHub Desktop.
Save n8henrie/591110cba073ab4fc0b1 to your computer and use it in GitHub Desktop.
Quick function to download a file from the AUR with just the package name
# Quick function to download a file from the AUR with just the package name
# Usage: aur_download packagename
# You will then need to do the usual AUR stuff, i.e. tar -xvf package.tar.gz; cd; makepkg -s; pacman -U;
# Quick import for bash >= 4 (e.g. Arch): source <(curl -sL http://n8h.me/1BtQtGF)
function aur_download() {
aur_url="https://aur.archlinux.org$(curl -s "https://aur.archlinux.org/packages/$1" | ack -o "(?<=href=\")/packages.*?$1.*?tar.gz(?=\">)")"
echo "$aur_url"
read -p "Download the above url? [yn] " response
case $response in
[Yy])
wget "$aur_url"
echo "You still need to do the usual: tar -xvf; cd; makepkg -s; pacman -U;"
;;
*)
echo "I guess not."
;;
esac
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment