3 # Test whether all required packages are installed and generate a mail
4 # if they aren't, so that the admin is informed.
6 required="subversion gettext locales rsync dpkg-dev procmail"
7 required="$required libcompress-zlib-perl"
8 required="$required libhtml-parser-perl libio-stringy-perl"
9 required="$required liblocale-gettext-perl libmldbm-perl"
10 required="$required libtext-iconv-perl libhtml-template-perl"
11 required="$required libclass-accessor-perl"
12 required="$required liburi-perl libxml-rss-perl"
13 required="$required libtemplate-perl libi18n-acceptlanguage-perl"
15 locales="de_DE.UTF-8 en_US.UTF-8 nl_NL fr_FR.UTF-8"
20 trap "rm -f $packages $locs" INT EXIT
24 if [ -z "$(dpkg -l $p|grep ^ii)" ]
26 echo "Package $p missing." >> $packages
33 if ! grep -q "^$l" /etc/locale.gen
35 echo "Locale $l missing." >> $locs
42 if [ ! -d "$cachedir" ]
44 echo "cachedir missing." >> $cache
46 perm=$(ls -ld "$cachedir" | perl -ne 'print "ok" if /^drwxrws--- \d+ www-data/')
49 echo "cachedir has wrong permissions." >> $cache
50 echo "make sure it is writable by the web server." >> $cache
55 if [ -s $packages -o -s $locs -o -s $cache ]
58 echo "Subject: Problem packages.debian.org on `hostname -s`"
59 echo "To: ${admin_email}"
61 echo "On host `hostname -f`"
65 echo "Missing packages:"
71 echo "Missing locales:"
77 echo "Problems with cachedir:"
81 ) | /usr/sbin/sendmail -t