]> git.deb.at Git - deb/packages.git/blob - cron.d/050checkinst
Some fixes for Polish translation.
[deb/packages.git] / cron.d / 050checkinst
1 #! /bin/sh
2
3 . `dirname $0`/../config.sh
4
5 # Test whether all required packages are installed and generate a mail
6 # if they aren't, so that the admin is informed.
7
8 packages=`tempfile`
9 cache=`tempfile`
10 trap "rm -f $packages $cache" INT EXIT
11
12 cd $topdir
13 dpkg-checkbuilddeps >> $packages 2>&1
14
15 if [ -n "$cachedir" ]
16 then
17     if [ ! -d "$cachedir" ]
18     then
19         echo "cachedir missing." >> $cache
20     else
21         perm=$(ls -ld "$cachedir" | perl -ne 'print "ok" if /^drwx...... \d+ www-data/ || /^d...rws... \d+ [\w-]+\/www-data/')
22         if [ -z "$perm" ]
23         then
24             echo "cachedir has wrong permissions." >> $cache
25             echo "make sure it is writable by the web server." >> $cache
26         fi
27     fi
28 fi
29
30 if [ -s $packages -o -s $cache ]
31 then
32     (
33         echo "Subject: Problem packages.debian.org on `hostname -s`"
34         echo "To: ${admin_email}"
35         echo
36         echo "On host `hostname -f`"
37         echo
38         if [ -s $packages ]
39         then
40             echo "Missing packages:"
41             echo
42             cat $packages
43         fi
44         if [ -s $cache ]
45         then
46             echo "Problems with cachedir:"
47             echo
48             cat $cache
49         fi
50     ) | tee /dev/stderr | /usr/sbin/sendmail -t
51 fi