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