3 . `dirname $0`/../config.sh
5 # Test whether all required packages are installed and generate a mail
6 # if they aren't, so that the admin is informed.
10 trap "rm -f $packages $cache" INT EXIT
13 dpkg-checkbuilddeps >> $packages 2>&1
17 if [ ! -d "$cachedir" ]
19 echo "cachedir missing." >> $cache
21 perm=$(ls -ld "$cachedir" | perl -ne 'print "ok" if /^drwx...... \d+ www-data/ || /^d...rws... \d+ [\w-]+\/www-data/'
24 echo "cachedir has wrong permissions." >> $cache
25 echo "make sure it is writable by the web server." >> $cache
30 if [ -s $packages -o -s $cache ]
33 echo "Subject: Problem packages.debian.org on `hostname -s`"
34 echo "To: ${admin_email}"
36 echo "On host `hostname -f`"
40 echo "Missing packages:"
46 echo "Problems with cachedir:"
50 ) | tee /dev/stderr | /usr/sbin/sendmail -t