From 978a4e28ebad25adc76e5d145222b4bf3855535c Mon Sep 17 00:00:00 2001 From: Eduardo Cavazos Date: Fri, 15 Feb 2008 03:17:30 -0600 Subject: [PATCH] builder: minor tweaks --- extra/builder/builder.factor | 16 +++++++++++++--- extra/builder/util/util.factor | 3 +++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/extra/builder/builder.factor b/extra/builder/builder.factor index 00e39be2ba..572cd6d52c 100644 --- a/extra/builder/builder.factor +++ b/extra/builder/builder.factor @@ -69,13 +69,19 @@ VAR: stamp ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +SYMBOL: build-status + : (build) ( -- ) + build-status off + enter-build-dir "report" [ "Build machine: " write host-name print + "CPU: " write cpu print + "OS: " write os print "Build directory: " write cwd print git-clone [ "git clone failed" print ] run-or-bail @@ -88,7 +94,7 @@ VAR: stamp make-vm [ "vm compile error" print "../compile-log" cat ] run-or-bail - [ my-arch download-image ] [ "Image download error" print throw ] recover + [ retrieve-image ] [ "Image download error" print throw ] recover bootstrap [ "Bootstrap error" print "../boot-log" cat ] run-or-bail @@ -106,7 +112,9 @@ VAR: stamp "Benchmarks: " print "../benchmarks" [ stdio get contents eval ] with-file-in benchmarks. - ] with-file-out ; + ] with-file-out + + build-status on ; ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @@ -114,12 +122,14 @@ SYMBOL: builder-recipients : tag-subject ( str -- str ) { "builder@" host-name* ": " , } bake to-string ; +: subject ( -- str ) build-status get [ "report" ] [ "error" ] if ; + : build ( -- ) [ (build) ] [ drop ] recover "ed@factorcode.org" >>from builder-recipients get >>to - "report" tag-subject >>subject + subject >>subject "../report" file>string >>body send ; diff --git a/extra/builder/util/util.factor b/extra/builder/util/util.factor index 70f3083f57..f9f432a8f6 100644 --- a/extra/builder/util/util.factor +++ b/extra/builder/util/util.factor @@ -81,3 +81,6 @@ 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