postinst 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #! /bin/sh
  2. # apt postinst, based liberally on James Troup's gpm postinst
  3. # Copyright (C) 1998, Ben Gertzfield <che@debian.org>
  4. # This program is free software; you can redistribute it and/or modify
  5. # it under the terms of the GNU General Public License as published by
  6. # the Free Software Foundation; either version 2 of the License, or
  7. # (at your option) any later version.
  8. set -e
  9. create_apt_conf ()
  10. {
  11. echo "/etc/apt/sources.list does not exist; creating a default setup."
  12. cat > /etc/apt/sources.list <<EOF
  13. # See sources.list(5) for more information, especialy
  14. # Remember that you can only use http, ftp or file URIs
  15. # CDROMs are managed throught the apt-cdrom tool.
  16. # Proxy configuration is covered through environment variables or
  17. #
  18. deb http://http.us.debian.org/debian stable main contrib non-free
  19. deb http://non-us.debian.org/debian-non-US stable non-US
  20. deb http://security.debian.org stable updates
  21. # Uncomment if you want the apt-get source function to work
  22. #deb-src http://http.us.debian.org/debian stable main contrib non-free
  23. #deb-src http://non-us.debian.org/debian-non-US stable non-US
  24. EOF
  25. }
  26. check_apt_conf ()
  27. {
  28. true
  29. # this is for future expansion
  30. }
  31. case "$1" in
  32. configure)
  33. ldconfig
  34. #
  35. # If there is no /etc/apt/sources.list then create a default
  36. #
  37. if [ ! -f /etc/apt/sources.list ]; then
  38. create_apt_conf
  39. echo
  40. echo "If you wish to change the default sites from which APT fetches Debian"
  41. echo "packages, please edit the file /etc/apt/sources.list."
  42. else
  43. check_apt_conf
  44. fi
  45. if [ -f /usr/sbin/dhelp_parse ]; then
  46. /usr/sbin/dhelp_parse -a /usr/doc/apt
  47. fi
  48. esac