debian-view 828 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #! /bin/sh
  2. dpkg="dpkg"
  3. echo "Info for debian package '$1':"
  4. dpkg-deb --info $1
  5. echo " "
  6. echo "Do you wish to:"
  7. echo " - I)nstall the package now,"
  8. echo " - S)ave it to a file, or"
  9. echo " - Q)uit now"
  10. echo -n "Your choice (I/S/Q)? "
  11. read choice
  12. case "$choice" in
  13. [iI])
  14. if [ `id --user` -ne 0 ]
  15. then
  16. echo "Installation of Debian packages needs to be done as root."
  17. echo -n "Enter command used to become root (default=sudo): "
  18. read sudo
  19. if [ -z "$sudo" ]; then
  20. sudo="sudo"
  21. fi
  22. dpkg="$sudo $dpkg"
  23. fi
  24. echo " "
  25. echo "Installing package..."
  26. eval "$dpkg --install '$1'"
  27. ;;
  28. [sS])
  29. echo -n "Save as? "
  30. read filename
  31. echo "Saving '$filename'..."
  32. cat "$1" >$filename
  33. ;;
  34. esac
  35. echo " "
  36. echo -n "Done. Press <return> to continue: "
  37. read dummy
  38. echo " "