Gentoo installation script
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

gpkg.sh 1.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. # /etc/profile.d/gein.sh
  2. gpkg() {
  3. if [ $EUID -ne 0 ]; then
  4. if [ -e $(command -v sudo) ]; then
  5. SU="sudo"
  6. else
  7. SU="su -c"
  8. fi
  9. fi
  10. case $1 in
  11. -S|sync)
  12. echo "gpkg: syncing Portage..."
  13. $SU emerge -q --sync &&
  14. echo "gpkg: Portage sync completed"
  15. ;;
  16. -i|install)
  17. $SU emerge -av --quiet-build ${@:2}
  18. ;;
  19. -r|--remove)
  20. $SU emerge -avc --quiet-build ${@:2}
  21. ;;
  22. -p|--purge)
  23. $SU gpkg -r $(qlist -CI ${@:2})
  24. ;;
  25. -c|--clean)
  26. $SU emerge -av --depclean --quiet-build
  27. ;;
  28. -u|--update)
  29. case $2 in
  30. -w|--world)
  31. $SU emerge -avuDU --keep-going --with-bdeps=y \
  32. --quiet-build @world
  33. ;;
  34. -s|--system)
  35. $SU emerge -avuDN --quiet-build @system
  36. ;;
  37. *)
  38. echo "gpkg: update: Available options:"
  39. echo " -w, --world Update world packages"
  40. echo " -s, --system Update system packages"
  41. ;;
  42. esac
  43. ;;
  44. *)
  45. echo "gpkg: Available options:"
  46. echo " -S, --sync Sync Portage"
  47. echo " -i, --install Install a package"
  48. echo " -r, --remove Safely remove a package"
  49. echo " -p, --purge Purge package and dependencies"
  50. echo " -c, --clean Remove unneeded packages"
  51. echo " -u, --update Update packages"
  52. echo " -w, --world Update world packages"
  53. echo " -s, --system Update system packages"
  54. ;;
  55. esac
  56. }