cron.unchecked 1.3 KB
Newer Older
J
sync  
James Troup 已提交
1 2 3
#! /bin/sh

set -e
J
James Troup 已提交
4
export SCRIPTVARS=/org/ftp.debian.org/katie/vars
J
sync  
James Troup 已提交
5 6
. $SCRIPTVARS

A
Anthony Towns 已提交
7 8
LOCKFILE="$lockdir/unchecked.lock"
NOTICE="$lockdir/daily.lock"
9

A
Anthony Towns 已提交
10 11 12 13
cleanup() {
  rm -f "$LOCKFILE"
  if [ ! -z "$LOCKDAILY" ]; then
	  rm -f "$NOTICE"
14
  fi
A
Anthony Towns 已提交
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
}

# only run one cron.unchecked
if lockfile -r3 $LOCKFILE; then
	trap cleanup 0
	cd $unchecked

	changes=$(find . -maxdepth 1 -mindepth 1 -type f -name \*.changes | sed -e "s,./,," | xargs)
	report=$queuedir/REPORT
	timestamp=$(date "+%Y-%m-%d %H:%M")

	if [ ! -z "$changes" ]; then
		echo "$timestamp": "$changes"  >> $report
		jennifer -a $changes >> $report
		echo "--" >> $report

		if lockfile -r3 $NOTICE; then
			LOCKDAILY="YES"
33
			psql projectb -A -t -q -c "SELECT filename FROM queue_build WHERE queue = 0 AND suite = 5 AND in_queue = true AND filename ~ 'd(sc|eb)$'" > $dbdir/dists/unstable_accepted.list
A
Anthony Towns 已提交
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
			cd $overridedir
			denise &>/dev/null
			rm -f override.sid.all3 override.sid.all3.src
			for i in main contrib non-free main.debian-installer; do
				cat override.sid.$i >> override.sid.all3
				if [ "$i" != "main.debian-installer" ]; then
					cat override.sid.$i.src >> override.sid.all3.src
				fi
			done
			cd $masterdir
			apt-ftparchive -qq generate apt.conf.buildd
			. $masterdir/cron.buildd
		fi
	else
		echo "$timestamp": Nothing to do >> $report
	fi
fi