chiark / gitweb /
Test suite: When sbuild fails, do not crash
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 1 Jul 2016 21:32:53 +0000 (22:32 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 1 Jul 2016 21:32:56 +0000 (22:32 +0100)
... due to sed not finding the log file.  Instead, simply tolerate the
absence of the log file.

debian/changelog
tests/tests/build-modes-sbuild

index a1b56a81fed18c22a8370762350b66b3399dca5c..44b39aecf9bc77c9e301d840d15430418eae9ad9 100644 (file)
@@ -7,6 +7,10 @@ dgit (1.5~~) unstable; urgency=medium
     has been changed recently and now this default setting is very awkward
     to change for the dgit user.
 
+  Test suite:
+  * When sbuild fails, do not crash due to sed not finding the log
+    file.  Instead, simply tolerate the absence of the log file.
+
  --
 
 dgit (1.4) unstable; urgency=high
index 826c46734d87f3e194c4c92caf9ab83e6cc5a4d3..a4ffcf5b6a3e8f175f63ed186b2ea620beef2ebb 100755 (executable)
@@ -15,9 +15,12 @@ after-hook () {
        # run.  We know it must be running it in the chroot because we
        # provide sbuild with the dsc, not the tree, so we simply
        # ignore all executions of the clean target by schroot.
-       sed '
-               s/^EXAMPLE RULES TARGET clean/HOOK SUPPRESSED &/;
-       ' ../example_1.0_$arch.build >>$bmlog
+       local sblog=../example_1.0_$arch.build
+       if [ -e $sblog ]; then
+               sed '
+                       s/^EXAMPLE RULES TARGET clean/HOOK SUPPRESSED &/;
+               ' <$sblog >>$bmlog
+       fi
 }
 bm_quirk_after_act=after-hook