ricod1996

pacwrap

Jun 12th, 2016
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.08 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. action=$1
  4.  
  5. case $action in
  6.     install)
  7.         shift
  8.         pacaur -S "$@"
  9.         ;;
  10.     upgrade)
  11.         shift
  12.         pacaur -Su "$@"
  13.         ;;
  14.     update)
  15.         shift
  16.         pacaur -Sy "$@"
  17.         ;;
  18.     upup)
  19.         shift
  20.         pacaur -Syu "$@"
  21.         ;;
  22.     remove)
  23.         shift
  24.         pacaur -R "$@"
  25.         ;;
  26.     search)
  27.         shift
  28.         pacaur -Ss "$@"
  29.         ;;
  30.     autoremove)
  31.         shift
  32.         packages_to_remove=$(pacaur -Qdtq)
  33.         if [[ -z "$packages_to_remove" ]]; then
  34.             echo "Nothing to remove, all clean."
  35.         else
  36.             echo "NOTE: This operation might go through multiple cycles (for example when dependencies of dependencies can be removed after the first cycle)."
  37.             echo "This is normal and expected behaviour."
  38.             echo ""
  39.             while [[ -n "$packages_to_remove" ]]; do
  40.                 pacaur -R "$packages_to_remove"
  41.                 packages_to_remove=$(pacaur -Qdtq)
  42.             done
  43.         fi
  44.         ;;
  45.     -*)
  46.         pacaur "$@"
  47.         ;;
  48. esac
Advertisement
Add Comment
Please, Sign In to add comment