ispravak lintian upozorenja
[apt-cn.git] / debian / postinst
1 #!/bin/sh
2
3 set -e
4
5 [ "$1" = "configure" ] || exit 0
6 [ "$DEBIAN_SCRIPT_DEBUG" ] && set -vx
7
8 repos_regexp="
9 ^deb .*tp://security.debian.org.*squeeze/updates main contrib non-free
10 ^deb .*tp://ftp.hr.debian.org/.*debian.*squeeze main contrib non-free
11 ^deb .*tp://ftp.hr.debian.org/.*debian.*squeeze-updates main contrib non-free
12 ^deb .*tp://ftp.carnet.hr/carnet-debian.*squeeze main non-free"
13
14 repos="
15 1 deb http://security.debian.org/ squeeze/updates main contrib non-free
16 2 deb http://ftp.hr.debian.org/debian/ squeeze main contrib non-free
17 3 deb http://ftp.hr.debian.org/debian/ squeeze-updates main contrib non-free
18 4 deb http://ftp.carnet.hr/carnet-debian/ carnet-squeeze main non-free"
19
20 notneeded_repos_regexp="^deb.*tp://.*debian-non-US"
21
22 IFS="
23 "
24
25 counter=1
26 for i in $repos_regexp; do
27   if ! grep -q "$i" /etc/apt/sources.list; then
28     needed="$needed $counter"
29   fi
30   counter=$(($counter + 1))
31 done
32
33 if grep -q "$notneeded_repos_regexp" /etc/apt/sources.list; then
34   echo "CN: Following repositories are obsolete:"
35   grep "$notneeded_repos_regexp" /etc/apt/sources.list
36   echo ""
37 fi
38
39 if [ ! -z "$needed" ]; then
40   echo "CN: Following repositories are not found in your sources list:"
41   IFS=" "
42   for i in $needed; do
43     echo $repos | grep ^$i | cut -c3-300
44   done
45   echo ""
46   echo "CN: You can add the above to /etc/apt/sources.list or just:"
47   echo "CN: # install-carnet-sources.list"
48 fi
49
50 #DEBHELPER#