From 6281e0a95dab28ecfa2a47a3db8b4076a3cffd08 Mon Sep 17 00:00:00 2001 From: Eduardo Cavazos Date: Tue, 19 Feb 2008 16:45:19 -0600 Subject: [PATCH] builder: only email the last 100 lines of the test-log --- extra/builder/builder.factor | 2 +- extra/builder/util/util.factor | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/extra/builder/builder.factor b/extra/builder/builder.factor index 50d66f0a96..d8305041ab 100644 --- a/extra/builder/builder.factor +++ b/extra/builder/builder.factor @@ -137,7 +137,7 @@ SYMBOL: build-status bootstrap [ "Bootstrap error" print "../boot-log" cat ] run-or-bail - builder-test [ "Test error" print "../test-log" cat ] run-or-bail + builder-test [ "Test error" print "../test-log" 100 cat-n ] run-or-bail "../test-log" delete-file diff --git a/extra/builder/util/util.factor b/extra/builder/util/util.factor index f9eb17c565..0e68cdbc0e 100644 --- a/extra/builder/util/util.factor +++ b/extra/builder/util/util.factor @@ -83,4 +83,19 @@ TUPLE: process* arguments stdin stdout stderr timeout ; USING: bootstrap.image bootstrap.image.download io.streams.null ; -: retrieve-image ( -- ) [ my-arch download-image ] with-null-stream ; \ No newline at end of file +: retrieve-image ( -- ) [ my-arch download-image ] with-null-stream ; + +! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +: longer? ( seq seq -- ? ) [ length ] 2apply > ; + +: maybe-tail* ( seq n -- seq ) + 2dup longer? + [ tail* ] + [ drop ] + if ; + +: cat-n ( file n -- ) + [ file-lines ] [ ] bi* + maybe-tail* + [ print ] each ; \ No newline at end of file