chiark / gitweb /
* adt-testreport-onepackage: Handling of source packages'
[autopkgtest.git] / runner / adt-testreport-onepackage
index d912fd74e5066d57547bc897a4efd91b3995f0bc..3908e7ce9013bb343be1917125456e57567a48b4 100755 (executable)
@@ -2,16 +2,9 @@
 
 set -e
 
-mirror=http://mirror.relativity.greenend.org.uk/mirror/ubuntu.good
-distro=feisty
-suite=main
 salt=''
 tmp=tmp
 var=var
-administrator_email=ian@davenant.greenend.org.uk
-maintainer_email_override="$administrator_email"
-salutation="Ian"
-from="$salutation Jackson <ian@davenant.greenend.org.uk>"
 rsync=rsync
 disable=true
 interactive=true
@@ -106,6 +99,7 @@ if [ "x$pkg" = x ]; then
                return if $score < $best_score
                     or ($score==$best_score and \
                         $package gt $best_package);
+#printf STDERR " <----- best score=%s best_score=%s\n", $score, $best_score;
                $best_score= $score;
                $best_package= $package;
        }
@@ -131,8 +125,10 @@ if [ "x$pkg" = x ]; then
                        $score= 1e7 if $score>1e7;
                        $score *= 5 if $lastver{$package} ne $version;
                        $score *= 10 unless $extras{$package} =~ m/ nt /;
+#print STDERR "$package score $score\n";
                } elsif (m/^Architecture:.*/ &&
-                        !m/\s'$arch'\s/) {
+                        !m/\s(?:'$arch'|all|any)\s/) {
+#printf STDERR " <----- skip %s %s\n", $&, "'$arch'";
                        $skip= 1;
                } elsif (m/^$/) {
                        endpackage();
@@ -234,14 +230,15 @@ xrc adt-run --tmp-dir "$tp"/tmp                           \
  ---                                                   \
  adt-virt-xenlvm                                       \
        $adtvirt_extra_opts                             \
- --                                                    \
        --distro="$distro"                              \
+ --                                                    \
  2>&1 3>&- 4>&-
 
 printf >&3 "%s " $rc
 
 ourx=0
 upload=true
+: ${upload_if_notests:=false}
 extras=''
 
 case "$rc" in
@@ -250,7 +247,7 @@ case "$rc" in
 2)     summary='OK (some skipped)';            email=''
                                        upload=$upload_if_ok            ;;
 8)     summary='package declares no tests';    email=''
-                                       upload=false; extras='nt'       ;;
+                               upload=$upload_if_notests; extras='nt'  ;;
 4|6)   summary='test(s) failed!';      email="$maintainer_email"       ;;
 12)    summary='erroneous package!';   email="$maintainer_email"       ;;
 16)    summary='testbed failed!';      email="administrator_email"     ;;
@@ -261,7 +258,8 @@ progress "RESULTS $summary"
 
 if $upload; then
        progress "bundling"
-       ln "$tmp"/_summary "$tp"/summary
+       printf "\n%s\n" "$summary" >>"$tmp"/_summary
+       ln -f "$tmp"/_summary "$tp"/summary
 
        for odir in tmp out; do
                if test -d "$tp"/$odir; then
@@ -358,7 +356,7 @@ else
        if $interactive; then
                cat "$tmp"/_email >&2
        else
-               sendmail -odq -oem -t -oi <"$tmp"/_email
+               sendmail -odi -oem -t -oi <"$tmp"/_email
        fi
 fi