Advertisement
cgrunwald

Untitled

Dec 30th, 2010
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.76 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # Where to store the PKGBUILDs for when you want to
  4. # uninstall their packages.
  5. PACKAGE_FOLDER=/usr/lib/aur-pkgs
  6.  
  7. # Make sure the user has sudo/root.
  8. if [ "$(id -u)" != "0" ]; then
  9.     echo "Sorry, you need to sudo to use this command."
  10.     exit 1
  11. fi
  12.  
  13. if [ $# -ne 2 ]; then
  14.     echo "Usage:"
  15.     echo "  aur-get [url] [name]"
  16.     echo " "
  17.     exit 1
  18. fi
  19.  
  20. # Make the folder if it doesn't exist
  21. if [ ! -d "$PACKAGE_FOLDER" ]; then
  22.     mkdir "$PACKAGE_FOLDER"
  23. fi
  24.  
  25. # All the variables.
  26. url=$1
  27. title=$2
  28. pkg=$(basename $url)
  29. cache=$PACKAGE_FOLDER/$title
  30.  
  31. # Make our destination folder..
  32. if [ ! -d "$cache" ]; then
  33.     mkdir "$cache"
  34. fi
  35.  
  36. # Download
  37. echo "Getting $cache's $pkg.."
  38. wget --output-document="$cache/$pkg" $url
  39.  
  40. # Build it.
  41. pushd /tmp
  42. makepkg -ic -p "$cache/$pkg" --asroot --noconfirm
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement