pkg-up 673 B

12345678910111213141516171819202122232425262728293031
  1. #!/bin/sh
  2. if [ "$1" = "help" ]; then
  3. echo "*** Description ***"
  4. echo "Updates all installed packages using system package manager"
  5. echo ""
  6. echo "*** Usage ***"
  7. echo "pkg-up"
  8. echo ""
  9. echo "*** Parameters ***"
  10. echo ""
  11. echo "*** Options ***"
  12. echo ""
  13. exit 0
  14. fi
  15. void () {
  16. if [ -f /usr/bin/xbps-install ]; then
  17. echo "Doing dry run"
  18. xbps-install -SuMyn "$@"
  19. echo "Finished dry run, continue?"
  20. doas xbps-install -SuM "$@"
  21. [ -f /usr/bin/xcheckrestart ] && xcheckrestart
  22. [ -f /bin/updatedb ] && doas updatedb
  23. exit 1
  24. fi
  25. }
  26. void "$@"
  27. echo "Cannot determain package manager"