From: Ian Jackson Date: Fri, 1 Jul 2016 21:32:53 +0000 (+0100) Subject: Test suite: When sbuild fails, do not crash X-Git-Tag: archive/debian/2.0~379 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=commitdiff_plain;h=fbf7faf2761cbb5333bf75b993fa56d460d0fa39 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. --- diff --git a/debian/changelog b/debian/changelog index a1b56a81..44b39aec 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 diff --git a/tests/tests/build-modes-sbuild b/tests/tests/build-modes-sbuild index 826c4673..a4ffcf5b 100755 --- a/tests/tests/build-modes-sbuild +++ b/tests/tests/build-modes-sbuild @@ -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