postinst 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. cp /usr/doc/apt/examples/sources.list /etc/apt/sources.list
  13. }
  14. check_apt_conf ()
  15. {
  16. true
  17. # this is for future expansion
  18. }
  19. case "$1" in
  20. configure)
  21. ldconfig
  22. #
  23. # If there is no /etc/apt/sources.list then create a default
  24. #
  25. if [ ! -f /etc/apt/sources.list ]; then
  26. create_apt_conf
  27. echo
  28. echo "If you wish to change the default sites from which APT fetches Debian"
  29. echo "packages, please edit the file /etc/apt/sources.list."
  30. else
  31. check_apt_conf
  32. fi
  33. if [ -f /usr/sbin/dhelp_parse ]; then
  34. /usr/sbin/dhelp_parse -a /usr/doc/apt
  35. fi
  36. esac
  37. #DEBHELPER#