From 1723cb60c4260dd9f4ffdaf8870c2befef36c9cf Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 25 Oct 2007 18:18:06 +0100 Subject: [PATCH] more suppressions wip --- hosts/magrathea/get-suppressions.pl | 16 ++++++-- hosts/magrathea/update-suppressions | 61 +++++++++++++++++++---------- 2 files changed, 53 insertions(+), 24 deletions(-) diff --git a/hosts/magrathea/get-suppressions.pl b/hosts/magrathea/get-suppressions.pl index 357f5b4..2d79992 100755 --- a/hosts/magrathea/get-suppressions.pl +++ b/hosts/magrathea/get-suppressions.pl @@ -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); diff --git a/hosts/magrathea/update-suppressions b/hosts/magrathea/update-suppressions index ed519fb..0b3aa4f 100644 --- a/hosts/magrathea/update-suppressions +++ b/hosts/magrathea/update-suppressions @@ -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+", -' 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 "$@" -- 2.30.2