5 mirror=http://mirror.relativity.greenend.org.uk/mirror/ubuntu.good
11 administrator_email=ian@davenant.greenend.org.uk
12 maintainer_email_override="$administrator_email"
14 from="$salutation Jackson <ian@davenant.greenend.org.uk>"
17 destdirtail=autopkgtest-output/$distro
18 destrsynchead=ijackson@chiark:public-html/
19 desthttphead=http://www.chiark.greenend.org.uk/~ijackson/
27 echo "++++++ $1 ++++++"
31 progress "fetching $1"
35 gurl "$mirror/dists/$distro/$suite/source/Sources.gz" "$tmp"/sources.gz
36 zcat "$tmp"/sources.gz >"$tmp"/sources-in
38 sed -n 's/^Package: \([-+.0-9a-z][-+.0-9a-z]*\)$/\1/p' \
39 <"$tmp"/sources-in >"$tmp"/sources-packages
41 if test -f "$var"/last; then
42 sed -e 's/$/ _/' "$var"/last >>"$tmp"/sources-packages
44 echo ' _' >>"$tmp"/sources-packages
47 sort <"$tmp"/sources-packages >"$tmp"/all-sorted
50 if ($now) { print or die $!; $now++; exit; }
52 END { die unless $now>1; }
56 progress "selected $pkg"
58 sed -n "/^Package: $pkg\$/,/^\$/p" \
59 <"$tmp"/sources-in >"$tmp"/this-stanza
61 cat "$tmp"/this-stanza
65 sed -n '\''s/^'$1': //p'\'' \
73 sed -n '/^Files:/,/^([^ ].*)?$/{ /^ /{
74 s/^ [0-9a-z][0-9a-z]* *[0-9][0-9]* //; p
80 mkdir "$tp" "$tp/src" "$tp/tmp" "$tp/out"
82 for leafname in $leafnames; do
83 df="$tp/src/$leafname"
85 */*|.*) echo >&2 "bad leafname: $leafname"; exit 1;;
88 gurl "$mirror/pool/$suite/$pDirectory/$leafname" "$df"
91 if [ "x$maintainer_email_override" = x ]; then
93 maintainer_email=pMaintainer
95 maintainer_email=maintainer_email_override
98 progress "starting test"
108 xrc adt-run --tmp-dir "$tp"/tmp \
109 --output-dir "$tp"/out \
110 --log-file "$tp"/log \
118 0) summary='all OK'; email='' ;;
119 2) summary='OK (some skipped)'; email='' ;;
120 8) summary='package declares no tests'; email='' ;;
121 4|6) summary='test(s) failed!'; email="$maintainer_email" ;;
122 12) summary='erroneous package!'; email="$maintainer_email" ;;
123 16) summary='testbed failed!'; email="administrator_email" ;;
124 *) summary='unexpected failure!'; email="administrator_email" ;;
127 progress "RESULTS $summary"
128 progress "contacting $email"
130 for odir in tmp out; do
131 if test -d "$tp"/$odir; then
132 GZIP=-2 tar -f "$tp"/$odir.tar.gz -C "$tp" -zc $odir
137 $rsync -rltH --safe-links --delete "$tp" "$destrsynchead/$destdirtail/"
139 if [ "x$email" != x ]; then
140 eval "email_addr=\$$email"
141 cat >"$tmp"/email <<END
144 Subject: autopkgtest $distro $pkg: $summary
146 Test executed for: $distro $pkg
149 This message is automatically generated by the autopkgtest package
150 testing system. You are receiving it because:
154 cat >>"$tmp"/email <<END
155 You are listed in the Maintainer field of the $pkg package in $distro
156 and the test results appear to indicate a problem with the package.
159 maintainer_email_override)
160 cat >>"$tmp"/email <<END
161 The test results appear to indicate a problem with the package
162 and reports for package maintainers for $distro are being directed to
163 $maintainer_email_override
167 cat >>"$tmp"/email <<END
168 You are the administrator for the autopkgtest installation.
172 echo >&2 "huh email $email is what why?"
176 cat >>"$tmp/email" <<END
178 The test log, which is intended to be sufficient to diagnose most
179 failures, can be found below. However, in case this is not
180 sufficient, another copy can be found along with output files, saved
181 temporary files, and so on, at:
182 $desthttphead/$destdirtail/
184 If you have any questions about this service please contact me at:
192 cat >>"$tmp"/email 2>&1 "$tmp"/log ||:
193 sendmail -odq -oem -t -oi <"$tmp"/email
196 printf >>"$var"/log "package=%s rc=%s emailed='%s'\n" \
197 "$pkg" $rc "$email_addr"
198 echo $pkg >"$var"/last.new
199 mv "$var"/last.new "$var"/last