Last active
August 29, 2015 14:09
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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