]> git.decadent.org.uk Git - dak.git/blob - config/backports.org/cron.unchecked
Wrap __doc__ and func_name in @session_wrapper.
[dak.git] / config / backports.org / cron.unchecked
1 #! /bin/sh
2 set -e
3 export SCRIPTVARS=/org/backports.org/dak-config/vars
4 . $SCRIPTVARS
5
6 LOCKFILE="$lockdir/unchecked.lock"
7 NOTICE="$lockdir/daily.lock"
8
9 cleanup() {
10   rm -f "$LOCKFILE"
11   if [ ! -z $LOCKDAILY ]; then
12           rm -f "$NOTICE"
13   fi
14 }
15 trap cleanup 0
16
17 # only run one cron.unchecked
18 if lockfile -r3 $LOCKFILE; then
19         cd $unchecked
20
21         changes=$(find . -maxdepth 1 -mindepth 1 -type f -name \*.changes | sed -e "s,./,," | xargs)
22         report=$queuedir/REPORT
23         timestamp=$(date "+%Y-%m-%d %H:%M")
24
25         if [ ! -z "$changes" ]; then
26                 echo "$timestamp": "$changes"  >> $report
27                 dak process-unchecked -a $changes >> $report
28                 echo "--" >> $report
29         else
30                 echo "$timestamp": Nothing to do >> $report
31         fi
32 fi
33
34 rm -f "$LOCKFILE"