Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # Where to store the PKGBUILDs for when you want to
- # uninstall their packages.
- PACKAGE_FOLDER=/usr/lib/aur-pkgs
- # Make sure the user has sudo/root.
- if [ "$(id -u)" != "0" ]; then
- echo "Sorry, you need to sudo to use this command."
- exit 1
- fi
- if [ $# -ne 2 ]; then
- echo "Usage:"
- echo " aur-get [url] [name]"
- echo " "
- exit 1
- fi
- # Make the folder if it doesn't exist
- if [ ! -d "$PACKAGE_FOLDER" ]; then
- mkdir "$PACKAGE_FOLDER"
- fi
- # All the variables.
- url=$1
- title=$2
- pkg=$(basename $url)
- cache=$PACKAGE_FOLDER/$title
- # Make our destination folder..
- if [ ! -d "$cache" ]; then
- mkdir "$cache"
- fi
- # Download
- echo "Getting $cache's $pkg.."
- wget --output-document="$cache/$pkg" $url
- # Build it.
- pushd /tmp
- makepkg -ic -p "$cache/$pkg" --asroot --noconfirm
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement