postinst 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. # Use for a local mirror - remove the ftp1 http lines for the bits
  14. # your mirror contains.
  15. # deb file:/your/mirror/here/debian stable main contrib non-free
  16. # See sources.list(5) for more information, especialy
  17. # Remember that you can only use http, ftp or file URIs
  18. # CDROMs are managed throught the apt-cdrom tool.
  19. deb http://http.us.debian.org/debian stable main contrib non-free
  20. deb http://non-us.debian.org/debian-non-US stable non-US
  21. EOF
  22. }
  23. check_apt_conf ()
  24. {
  25. true
  26. # this is for future expansion
  27. }
  28. case "$1" in
  29. configure)
  30. ldconfig
  31. #
  32. # If there is no /etc/apt/sources.list then create a default
  33. #
  34. if [ ! -f /etc/apt/sources.list ]; then
  35. create_apt_conf
  36. echo
  37. echo "If you wish to change the default sites from which APT fetches Debian"
  38. echo "packages, please edit the file /etc/apt/sources.list."
  39. else
  40. check_apt_conf
  41. fi
  42. if [ -f /usr/sbin/dhelp_parse ]; then
  43. /usr/sbin/dhelp_parse -a /usr/doc/apt
  44. fi
  45. esac