pkg-rm 649 B

12345678910111213141516171819202122232425262728293031
  1. #!/bin/sh
  2. if [ "$1" = "help" ]; then
  3. echo "*** Description ***"
  4. echo "Removes a package from the system using the system package manager"
  5. echo ""
  6. echo "*** Usage ***"
  7. echo "pkg-rm <package-name(s)>"
  8. echo ""
  9. echo "*** Parameters ***"
  10. echo "package-name(s): Name of packages to removed"
  11. echo ""
  12. echo "*** Options ***"
  13. echo ""
  14. exit 0
  15. fi
  16. void () {
  17. if [ -f /usr/bin/xbps-remove ]; then
  18. echo "Doing dry run"
  19. xbps-remove -oRyn "$@"
  20. echo "Finished dry run, continue?"
  21. doas xbps-remove -oR "$@"
  22. exit 1
  23. fi
  24. }
  25. void "$@"
  26. echo "Cannot determain package manager"