From: Philipp Kern Date: Thu, 18 Dec 2008 17:42:40 +0000 (+0000) Subject: introduce libtrigger.sh and put the architectures into it X-Git-Url: https://git.donarmstrong.com/?p=wannabuild.git;a=commitdiff_plain;h=53e031de24ea63ceaf5d37c336566663452c9323 introduce libtrigger.sh and put the architectures into it Furthermore copy curl_index from trigger.daily into it so that it can be used by other triggers. libtrigger.sh is included by both trigger.daily and trigger.often. --- diff --git a/libtrigger.sh b/libtrigger.sh new file mode 100644 index 0000000..0bc9cc4 --- /dev/null +++ b/libtrigger.sh @@ -0,0 +1,33 @@ +#ARCHS_oldstable="m68k arm sparc alpha powerpc i386 mips mipsel ia64 hppa s390" +ARCHS_stable="arm sparc alpha powerpc i386 amd64 mips mipsel ia64 hppa s390" +ARCHS_testing="$ARCHS_stable armel" +ARCHS_unstable="$ARCHS_testing" +CURLOPT="-q -s -S -R -f -Y 10 -y 120 -K /home/pkern/wanna-build/trigger.curlrc" + +curl_index () { + local url tmpname destname appendname curlopt + url="$1" + destname="$2" + appendname="$3" + tmpname=".$destname" + rc=0 + rm -f "$tmpname" + if [ -e "$destname" ]; then + refdate=`perl -e "print scalar gmtime(((stat ('$destname'))[9]))"` + curl $CURLOPT -z "$refdate" "$url" -o "$tmpname" + rc=$? + else + curl $CURLOPT "$url" -o "$tmpname" + rc=$? + fi + if [ $rc -eq 0 -a -e "$tmpname" ]; then + if gzip -t "$tmpname"; then + mv "$tmpname" "$destname" + else + rc=$? + fi + fi + gzip -dc "$destname" >> "$appendname" + return $rc +} + diff --git a/trigger.daily b/trigger.daily index 48d10af..73b1776 100755 --- a/trigger.daily +++ b/trigger.daily @@ -14,45 +14,16 @@ PATH="/bin:/usr/bin" DISTS="stable-security testing-security stable testing unstable" STATS_DISTS="unstable testing stable" SECTIONS="main contrib non-free" -ARCHS_oldstable="m68k arm sparc alpha powerpc i386 mips mipsel ia64 hppa s390" -ARCHS_stable="arm sparc alpha powerpc i386 amd64 mips mipsel ia64 hppa s390" -ARCHS_testing="$ARCHS_stable armel" -ARCHS_unstable="$ARCHS_testing" TMPDIR="/org/wanna-build/tmp" +LIBTRIGGER="/org/wanna-build/libtrigger.sh" LOCKFILE="/org/wanna-build/tmp/DB_Maintenance_In_Progress" MASTER="http://incoming.debian.org/debian/dists" MASTERBUILDD="http://incoming.debian.org/buildd" SECMASTER="http://security-master.debian.org/debian-security/dists" SECMASTERBUILDD=http://security-master.debian.org/buildd -CURLOPT="-q -s -S -R -f -Y 10 -y 120 -K /srv/wanna-build/trigger.curlrc" NEWARCH="" -curl_index () { - local url tmpname destname appendname curlopt - url="$1" - destname="$2" - appendname="$3" - tmpname=".$destname" - rc=0 - rm -f "$tmpname" - if [ -e "$destname" ]; then - refdate=`perl -e "print scalar gmtime(((stat ('$destname'))[9]))"` - curl $CURLOPT -z "$refdate" "$url" -o "$tmpname" - rc=$? - else - curl $CURLOPT "$url" -o "$tmpname" - rc=$? - fi - if [ $rc -eq 0 -a -e "$tmpname" ]; then - if gzip -t "$tmpname"; then - mv "$tmpname" "$destname" - else - rc=$? - fi - fi - gzip -dc "$destname" >> "$appendname" - return $rc -} +. "$LIBTRIGGER" DAY=`date +%w` diff --git a/trigger.often b/trigger.often index d478b20..eff4372 100755 --- a/trigger.often +++ b/trigger.often @@ -11,12 +11,14 @@ LANG=C PATH="/bin:/usr/bin" -ARCHS="arm armel sparc alpha powerpc i386 mips mipsel ia64 hppa s390 amd64" TMPDIR="/org/wanna-build/tmp" +LIBTRIGGER="/org/wanna-build/libtrigger.sh" WGETOPT="-q -t2 -w0 -T10" LOCKFILE="/org/wanna-build/tmp/DB_Maintenance_In_Progress" NEWARCH="" +. "$LIBTRIGGER" + if lockfile -! -l 3600 $LOCKFILE; then echo "Cannot lock $LOCKFILE" exit 1 @@ -48,14 +50,14 @@ if wget $WGETOPT http://incoming.debian.org/buildd/Packages.gz; then fi cp Sources.unstable.base Sources.unstable zcat Sources-unstable.accepted.gz >> Sources.unstable -for a in $ARCHS; do +for a in $ARCHS_unstable; do rm -f Packages.unstable.$a cp Packages.unstable.$a.base Packages.unstable.$a zcat Packages-unstable.accepted.gz >> Packages.unstable.$a done umask 007 -for a in $ARCHS ; do +for a in $ARCHS_unstable ; do if [ "$a" = "$NEWARCH" ]; then quinn-diff -i -A $a -a /org/buildd.debian.org/web/quinn-diff/sid/Packages-arch-specific -s Sources.unstable.$NEWARCH -p Packages.unstable.$a >> quinn-unstable.$a 2> /dev/null else