chiark / gitweb /
more suppressions wip
authorIan Jackson <ian@davenant.greenend.org.uk>
Thu, 25 Oct 2007 17:18:06 +0000 (18:18 +0100)
committerIan Jackson <ian@davenant.greenend.org.uk>
Thu, 25 Oct 2007 17:18:06 +0000 (18:18 +0100)
hosts/magrathea/get-suppressions.pl
hosts/magrathea/update-suppressions

index 357f5b43f1eea686ab429d8c5541d10316b9458a..2d79992bd9a44c284f74849c4e13005e416f7964 100755 (executable)
@@ -8,11 +8,19 @@ use SOAP::Lite;
 @ARGV==1 or die;
 my ($dist) = @ARGV;
 
-my $debbugs_soap= 'Debbugs/SOAP';
-my $debbugs_uri= 'http://bugs.debian.org/cgi-bin/soap.cgi';
+sub e ($) {
+    my ($v) = @_;
+    $v= 'suppressions_'.$v;
+    my $r= $ENV{$v};
+    die "need $v in environment" unless defined $r;
+    return $r;
+}
+
+my $debbugs_soap= e('debbugs_soap');
+my $debbugs_uri= e('debbugs_uri');
 
-my $usertag_owner= 'autopkgtest@packages.debian.org';
-my $usertag_name= "autopkgtest";
+my $usertag_owner= e('usertag_owner')
+my $usertag_name= e('usertag_name')
 
 my $soap= SOAP::Lite->uri($debbugs_soap)->proxy($debbugs_uri);
 
index ed519fb8e30ea46bf1198f8c97751971e36f9483..0b3aa4f6fb2ab76e870ce3746687f32b71a5fff6 100644 (file)
@@ -1,31 +1,52 @@
-#!/bin/sh
+#!/bin/bash
+#
+#  This script expects to be given at least two arguments:
+#     directory to cd to
+#     main config file for adt-testreport-runloop which sets PATH if need be
+#     remaining arguments are passed through to a-t-r unchanged
 
 set -e
 
-cd ${0%/*}
+export suppressions_kind=debbugs
+export suppressions_debbugs_soap=Debbugs/SOAP
+export suppressions_debbugs_uri=http://bugs.debian.org/cgi-bin/soap.cgi
+export suppressions_usertag_owner=autopkgtest@packages.debian.org
+export suppressions_usertag_name=autopkgtest
 
-echo 'fetching'
-curl -s -S -k -o webpage "$url"
+cd "$1"
+shift
+. "$1"
 
-echo 'grepping'
-perl -ne '
-    print "$1\n" or die $! if
-     m,"https://bugs.launchpad.net/ubuntu/\+source/([-+.0-9a-z]+)/\+bug/\d+",
-' <webpage >suppressions.new
+: "${suppressions_file_to_fetch:=$suppresspackages}"
+export suppressions_file_to_fetch
 
-nl -ba suppressions.new
+: "${suppressions_lockfile:=$suppressions_file_to_fetch-lock}"
 
-if ! test -s suppressions.new;
-then
-       echo >&2 'NO SUPPRESSIONS - PROBABLY WENT WRONG
+echo 'locking'
 
-webpage:'
-       cat webpage
-fi
+with-lock-ex -f "$suppressions_file_to_lock" bash -c '
+       . "$1"
 
-echo 'uploading'
+       f="$suppressions_file_to_fetch"
 
-mv suppressions.new suppressions
-RSYNC_RSH=ssh rsync suppressions cadmium.buildd:adt-play/.
+       echo fetching
+       ${suppressions_fetch:-adt-suppressions-fetch-$suppressions_kind} \
+               >"$f".new
 
-echo 'done.'
+       echo results
+       nl -ba -- "$f".new
+
+       if ! test -s "$f".new;
+       then
+               echo >&2 'NO SUPPRESSIONS - PROBABLY WENT WRONG
+               exit 1
+       fi
+
+       mv -- "$f".new "$f"
+
+       if [ "x$suppressions_copy_destination" != x ]; then
+               echo "uploading"
+               RSYNC_RSH=ssh rsync "$f" "$suppressions_copy_destination"
+       fi
+       echo done.
+' x "$@"