chiark / gitweb /
cbd61a5d3c86eaafe18b615f28c0777395c66ba0
[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
35 cd ${0%/*}
36
37 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'
38
39 echo 'fetching'
40 curl -s -S -k -o webpage "$url"
41
42 echo 'grepping'
43 perl -ne '
44     print "$1\n" or die $! if
45      m,"https://bugs.launchpad.net/ubuntu/\+source/([-+.0-9a-z]+)/\+bug/\d+",
46 ' <webpage >suppressions.new
47
48 nl -ba suppressions.new
49
50 if ! test -s suppressions.new;
51 then
52         echo >&2 'NO SUPPRESSIONS - PROBABLY WENT WRONG
53
54 webpage:'
55         cat webpage
56 fi
57
58 echo 'uploading'
59
60 mv suppressions.new suppressions
61 RSYNC_RSH=ssh rsync suppressions cadmium.buildd:adt-play/.
62
63 echo 'done.'