]> git.deb.at Git - deb/packages.git/commitdiff
import 010cvs (renamed to 010svn of course) and 050checkinst from old code. switch-to-templates
authorFrank Lichtenheld <frank@lichtenheld.de>
Sun, 19 Nov 2006 19:43:48 +0000 (19:43 +0000)
committerFrank Lichtenheld <frank@lichtenheld.de>
Sun, 19 Nov 2006 19:43:48 +0000 (19:43 +0000)
cron.d/010svn [new file with mode: 0755]
cron.d/050checkinst [new file with mode: 0755]

diff --git a/cron.d/010svn b/cron.d/010svn
new file mode 100755 (executable)
index 0000000..d709a41
--- /dev/null
@@ -0,0 +1,36 @@
+#! /bin/bash
+
+#   Copyright (c) 2004  Martin Schulze <joey@debian.org>
+#   Copyright (c) 2006  Frank Lichtenheld <djpig@debian.org>
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+. `dirname $0`/../config.sh
+
+logs=${topdir}/files/logs
+log=${logs}/svn.log
+
+cd ${topdir}
+
+test -d $log || mkdir -p $logs
+
+if [ -s $log ]
+then
+    savelog -c 14 $log > /dev/null
+fi
+
+date > $log
+svn update &> $log
+date >> $log
diff --git a/cron.d/050checkinst b/cron.d/050checkinst
new file mode 100755 (executable)
index 0000000..ad6397a
--- /dev/null
@@ -0,0 +1,61 @@
+#! /bin/sh
+
+# Test whether all required packages are installed and generate a mail
+# if they aren't, so that the admin is informed.
+
+required="subversion gettext locales rsync dpkg-dev procmail"
+required="$required libcompress-zlib-perl"
+required="$required libhtml-parser-perl libio-stringy-perl"
+required="$required liblocale-gettext-perl libmldbm-perl"
+required="$required libtext-iconv-perl libhtml-template-perl"
+required="$required libclass-accessor-perl"
+required="$required liburi-perl libxml-rss-perl"
+required="$required libtemplate-perl libi18n-acceptlanguage-perl"
+
+locales="de_DE.UTF-8 en_US.UTF-8 nl_NL fr_FR.UTF-8"
+
+packages=`tempfile`
+locs=`tempfile`
+trap "rm -f $packages $locs" INT EXIT
+
+for p in $required
+do
+    if [ -z "$(dpkg -l $p|grep ^ii)" ]
+    then
+       echo "Package $p missing." >> $packages
+       echo >> $packages
+    fi
+done
+
+for l in $locales
+do
+    if ! grep -q "^$l" /etc/locale.gen
+    then
+       echo "Locale $l missing." >> $locs
+       echo >> $locs
+    fi
+done
+
+if [ -s $packages -o -s $locs ]
+then
+    (
+       echo "Subject: Problem packages.debian.org on `hostname -s`"
+       echo "To: ${admin_email}"
+       echo
+       echo "On host `hostname -f`"
+       echo
+       if [ -s $packages ]
+       then
+           echo "Missing packages:"
+           echo
+           cat $packages
+       fi
+       if [ -s $locs ]
+       then
+           echo "Missing locales:"
+           echo
+           cat $locs
+       fi
+    ) | /usr/sbin/sendmail -t
+fi
+