chiark / gitweb /
* adt-run: increase timeouts to 3ks for tests and 10ks for builds.
[autopkgtest.git] / runner / adt-testreport-onepackage
index 3908e7ce9013bb343be1917125456e57567a48b4..f2f3e5d171c1f7f15e02c3fb8415316c81b5ee19 100755 (executable)
@@ -9,6 +9,7 @@ rsync=rsync
 disable=true
 interactive=true
 target=source
+suppressrepeatedemails=false
 arch=`dpkg --print-architecture`
 
 for config in "$@"; do
@@ -259,6 +260,23 @@ progress "RESULTS $summary"
 if $upload; then
        progress "bundling"
        printf "\n%s\n" "$summary" >>"$tmp"/_summary
+
+       edest=${email%_email}
+       esummary="$var"/emailed/last-$pkg,$edest
+       if [ "x$edest" = x ]; then
+               printf >&3 "email-none "
+               rm -f "$var"/emailed/last-$pkg,*
+               esummary=''
+       elif $suppressrepeatedemails \
+         && [ -f "$esummary" ] \
+         && diff -u "$esummary" "$tmp"/_summary >"$var"/emailed/diff-$pkg; then
+               printf >&3 "email-suppressed $email "
+               email=''
+               esummary=''
+       else
+               cp "$tmp"/_summary "$esummary".new
+       fi
+
        ln -f "$tmp"/_summary "$tp"/summary
 
        for odir in tmp out; do
@@ -357,6 +375,10 @@ else
                cat "$tmp"/_email >&2
        else
                sendmail -odi -oem -t -oi <"$tmp"/_email
+               if [ "x$esummary" != x ]; then
+                       printf >&3 "email-recorded "
+                       mv "$esummary".new "esummary"
+               fi
        fi
 fi