| 1 |
joy |
1.1 |
#!/bin/bash |
| 2 |
|
|
|
| 3 |
|
|
# see README for more information |
| 4 |
|
|
|
| 5 |
|
|
umask 002 |
| 6 |
rhonda-guest |
1.30 |
. /srv/www.debian.org/cron/common.sh |
| 7 |
joy |
1.1 |
|
| 8 |
|
|
# locking |
| 9 |
|
|
if lockfile -! -l 43200 -r 0 "$crondir/lessoften.lock"; then |
| 10 |
joy |
1.25 |
echo `hostname` is unable to start update, lock file exists. >> $crondir/log/lessoften.log |
| 11 |
joy |
1.1 |
exit 1 |
| 12 |
|
|
fi |
| 13 |
|
|
trap "rm -f $crondir/lessoften.lock" exit |
| 14 |
|
|
|
| 15 |
|
|
# rotate the previous log file |
| 16 |
debwww |
1.26 |
savelog $crondir/log/lessoften.log > /dev/null |
| 17 |
joy |
1.1 |
|
| 18 |
joy |
1.25 |
echo "starting the lessoften cron job at `date`" > $crondir/log/lessoften.log |
| 19 |
joy |
1.1 |
|
| 20 |
joy |
1.25 |
echo "creating mailing-lists.txt..." >> $crondir/log/lessoften.log |
| 21 |
joy |
1.1 |
make -s -C $webtopdir/webwml/english/MailingLists mailing-lists.txt |
| 22 |
|
|
install -m 664 -g debwww \ |
| 23 |
|
|
$webtopdir/webwml/english/MailingLists/mailing-lists.txt \ |
| 24 |
|
|
$webdir/misc/mailing-lists.txt |
| 25 |
|
|
|
| 26 |
joy |
1.25 |
echo "copying events/materials/ in place..." >> $crondir/log/lessoften.log |
| 27 |
joy |
1.1 |
install -d -m 2775 -g debwww $webdir/events/materials |
| 28 |
|
|
cp -a $webtopdir/events-materials/* $webdir/events/materials/ |
| 29 |
|
|
|
| 30 |
djpig |
1.23 |
# build installation guide for etch/lenny |
| 31 |
djpig |
1.19 |
cd $crondir/tmp |
| 32 |
|
|
igdsc=`ls -t1 $ftpdir/pool/main/i/installation-guide/installation-guide_*.dsc | head -1` |
| 33 |
djpig |
1.20 |
igdir=`basename "$igdsc" | |
| 34 |
|
|
sed -e 's/installation-guide_/installation-guide-/' -e 's/\.dsc//'` |
| 35 |
kraai |
1.29 |
if [ "$igdsc" -nt $webtopdir/installmanual/squeeze.log -a "$igdsc" -nt $webtopdir/installmanual/lenny.log ]; then |
| 36 |
|
|
echo "extracting installation-guide source..." >> $crondir/log/lessoften.log |
| 37 |
|
|
[ -d "$igdir" ] && rm -fr "$igdir" |
| 38 |
|
|
dpkg-source -sn -x "$igdsc" >> $crondir/log/lessoften.log |
| 39 |
|
|
if [ -d "$igdir" ]; then |
| 40 |
|
|
echo "building installation-guide for squeeze..." >> $crondir/log/lessoften.log |
| 41 |
|
|
cd $igdir/build && |
| 42 |
|
|
manual_release=squeeze destination=$webtopdir/installmanual/squeeze/ ./buildweb.sh > $webtopdir/installmanual/squeeze.log 2>&1 |
| 43 |
djpig |
1.19 |
fi |
| 44 |
kraai |
1.29 |
echo "copying squeeze installmanual in place..." >> $crondir/log/lessoften.log |
| 45 |
|
|
cp -a $webtopdir/installmanual/squeeze/* $webdir/releases/squeeze/ |
| 46 |
|
|
else |
| 47 |
|
|
echo no new installation-guide for squeeze, skipping build >> $crondir/log/lessoften.log |
| 48 |
|
|
fi |
| 49 |
djpig |
1.15 |
|
| 50 |
joy |
1.1 |
# previously in parts/1l10ndata, from bouz |
| 51 |
djpig |
1.16 |
[ -d $crondir/datafiles ] || mkdir -p $crondir/datafiles |
| 52 |
|
|
cd $crondir/datafiles |
| 53 |
joy |
1.25 |
echo "updating the database file used to display l10n stats..." >> $crondir/log/lessoften.log |
| 54 |
|
|
wget -q -N http://i18n.debian.net/material/data/unstable.gz || { echo "couldn't fetch data/unstable!" >> $crondir/log/lessoften.log; exit 1; } |
| 55 |
djpig |
1.22 |
gunzip -c -f unstable.gz > unstable.gluck |
| 56 |
|
|
ln -sf $crondir/datafiles/unstable.gluck $webtopdir/webwml/english/international/l10n/data/unstable.gluck |
| 57 |
kraai |
1.18 |
wget -q -N http://popcon.debian.org/source/by_inst && ln -sf $crondir/datafiles/by_inst $webtopdir/webwml/english/international/l10n/data/popcon |
| 58 |
joy |
1.1 |
|
| 59 |
|
|
# cleanup |
| 60 |
|
|
rm -f unstable.gz |
| 61 |
|
|
|
| 62 |
joy |
1.25 |
echo "extracting the list of languages..." >> $crondir/log/lessoften.log |
| 63 |
joy |
1.1 |
cd $webtopdir/webwml/english/international/l10n |
| 64 |
kraai |
1.5 |
./scripts/list-languages.pl data/unstable.gluck > data/langs |
| 65 |
debwww |
1.2 |
|
| 66 |
kraai |
1.27 |
echo "updating the status files used to build l10n stats..." >> $crondir/log/lessoften.log |
| 67 |
|
|
cd $crondir/datafiles |
| 68 |
|
|
wget -erobots=off -q -N -nd -r -l1 --no-parent -A"status.*" http://i18n.debian.net/debian-l10n/status/ || { echo "couldn't fetch status.*!" >> $crondir/log/lessoften.log; exit 1; } |
| 69 |
|
|
for status_file in status.*; do |
| 70 |
|
|
ln -sf $crondir/datafiles/$status_file $webtopdir/webwml/english/international/l10n/data/$status_file |
| 71 |
|
|
done |
| 72 |
|
|
|
| 73 |
joy |
1.25 |
echo "cleaning up obsolete templates translation information" >> $crondir/log/lessoften.log |
| 74 |
kraai |
1.17 |
cd $webdir/international/l10n |
| 75 |
kaare |
1.31 |
find po po-debconf -type f -mtime +30 -exec rm -f \{\} \; |
| 76 |
|
|
# Note by kaare: the above line said "po po-debconf templates ...", but "templates" removed since the directory has been deleted |
| 77 |
kraai |
1.17 |
|
| 78 |
debwww |
1.2 |
# the below scripts will echo what they are doing themselves |
| 79 |
joy |
1.25 |
$crondir/people_scripts/update.packages+sources >> $crondir/log/lessoften.log |
| 80 |
|
|
$crondir/people_scripts/update.people.html >> $crondir/log/lessoften.log |
| 81 |
joy |
1.1 |
|
| 82 |
taffit-guest |
1.32 |
echo "send a mail to concerned people about validation issues" |
| 83 |
|
|
$crondir/scripts/validate-mail >> $crondir/log/lessoften.log |
| 84 |
|
|
|
| 85 |
joy |
1.25 |
echo " ** lessoften cron job done *** " >> $crondir/log/lessoften.log |