chiark / gitweb /
* adt-xenlvm-with-testbed: sleep 1 after xm destroy, which is racy.
[autopkgtest.git] / runner / adt-openbugs-update
1 #!/bin/bash
2 #
3 #  This script expects to be given at least two arguments:
4 #     directory to cd to
5 #     main config file for adt-testreport-runloop which sets PATH if need be
6 #     remaining arguments are passed through to a-t-r unchanged
7
8 set -e
9
10 export openbugs_kind=debbugs
11 export openbugs_debbugs_soap=Debbugs/SOAP
12 export openbugs_debbugs_uri=http://bugs.debian.org/cgi-bin/soap.cgi
13 export openbugs_usertag_owner=autopkgtest@packages.debian.org
14 export openbugs_usertag_name=autopkgtest
15
16 cd "$1"
17 shift
18 . "$1"
19
20 : "${openbugs_file_to_fetch:=${suppresspackages:-openbugs}}"
21 export openbugs_file_to_fetch
22
23 : "${openbugs_file_to_lock:=$openbugs_file_to_fetch-lock}"
24
25 echo 'locking'
26
27 with-lock-ex -f "$openbugs_file_to_lock" bash -c '
28         . "$1"
29
30         f="$openbugs_file_to_fetch"
31
32         export distro
33
34         echo fetching
35         ${openbugs_fetch:-adt-openbugs-fetch-$openbugs_kind} \
36                 >"$f".new
37
38         echo results
39         nl -ba -- "$f".new
40
41         if ! test -s "$f".new;
42         then
43                 echo >&2 "NO OPENBUGS - PROBABLY WENT WRONG"
44                 exit 1
45         fi
46
47         mv -- "$f".new "$f"
48
49         if [ "x$openbugs_copy_destination" != x ]; then
50                 echo "uploading"
51                 RSYNC_RSH=ssh rsync "$f" "$openbugs_copy_destination"
52         fi
53         echo done.
54 ' x "$@"