chiark / gitweb /
merge from --ubuntu
[autopkgtest.git] / hosts / chinstrap / update-suppressions
1 #!/bin/sh
2 #
3 # This is an absolutely hideous hack.
4 #
5 # We scrape a suitable launchpad advanced search to find bugs we've
6 # previously submitted.
7 #
8 # We have to run this on chinstrap instead of
9 # cadmium because cadmium (being treated as a buildd from a security
10 # point of view) is not permitted to make external requests other than
11 # to the archive.
12 #
13 #
14 # For the reasons described below this should be replaced ASAP!
15 #
16 # BUGS
17
18 # This will break if the list gets too long for LP to display.
19 #
20 # Also, there is a problem with Duplicate bugs.  See LP #147754.  A
21 # tedious workaround is needed for this case.  When an autopkgtest
22 # bug, which was marked a duplicate and not the master, is fixed, the
23 # duplicate target will be marked fixed.  To work around the LP bug,
24 # it is necessary to adjust the status of the autopkgtest-filed bug:
25 #  1. unduplicate the bug; 2. set it to Fix Released;
26 #  3. duplicate it again.
27 #
28 # Occasionally LP seems to burp and give us an empty page.
29 # This means that a cronmail is generated which reports
30 #   NO SUPPRESSIONS - PROBABLY WENT WRONG
31 # It is not clear whether the lack of any error message or nonzero
32 # exit status from curl is a bug in curl or LP.
33
34 # Furthermore, much of this functionality is now in
35 # adt-openbugs-update and the LP part should be in a script called
36 # adt-openbugs-fetch-launchpad.
37
38
39 cd ${0%/*}
40
41 url='https://launchpad.net/ubuntu/+bugs?field.searchtext=&orderby=-importance&field.status%3Alist=New&field.status%3Alist=Incomplete&field.status%3Alist=Confirmed&field.status%3Alist=Triaged&field.status%3Alist=In+Progress&field.status%3Alist=Fix+Committed&assignee_option=any&field.assignee=&field.bug_reporter=ian%2Bubuntu-autopkgtest&field.bug_contact=&field.bug_commenter=&field.subscriber=&field.status_upstream-empty-marker=1&field.omit_dupes.used=&field.has_patch.used=&field.tag=&field.has_cve.used=&search=Search'
42
43 echo 'fetching'
44 curl -s -S -k -o webpage "$url"
45
46 echo 'grepping'
47 perl -ne '
48     print "$1\n" or die $! if
49      m,"https://bugs.launchpad.net/ubuntu/\+source/([-+.0-9a-z]+)/\+bug/\d+",
50 ' <webpage >suppressions.new
51
52 nl -ba suppressions.new
53
54 if ! test -s suppressions.new;
55 then
56         echo >&2 'NO SUPPRESSIONS - PROBABLY WENT WRONG
57
58 webpage:'
59         cat webpage
60         exit 1
61 fi
62
63 echo 'uploading'
64
65 mv suppressions.new suppressions
66 RSYNC_RSH=ssh rsync suppressions cadmium.buildd:adt-play/.
67
68 echo 'done.'