From 59c7e881da0465c697854b49c215d57363ba06ff Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Sun, 10 May 2009 16:40:19 -0500 Subject: [PATCH] mason: add retries in another place, and add a type declaration --- extra/mason/common/common.factor | 4 ++-- extra/mason/notify/notify.factor | 12 +++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/extra/mason/common/common.factor b/extra/mason/common/common.factor index d020c68fc4..b7545a3c9e 100755 --- a/extra/mason/common/common.factor +++ b/extra/mason/common/common.factor @@ -5,12 +5,12 @@ math.functions make io io.files io.pathnames io.directories io.directories.hierarchy io.launcher io.encodings.utf8 prettyprint combinators.short-circuit parser combinators calendar calendar.format arrays mason.config locals system debugger fry -continuations ; +continuations strings ; IN: mason.common SYMBOL: current-git-id -ERROR: output-process-error output process ; +ERROR: output-process-error { output string } { process process } ; M: output-process-error error. [ "Process:" print process>> . nl ] diff --git a/extra/mason/notify/notify.factor b/extra/mason/notify/notify.factor index 96e31c4a45..c75014e1b0 100644 --- a/extra/mason/notify/notify.factor +++ b/extra/mason/notify/notify.factor @@ -2,7 +2,7 @@ ! See http://factorcode.org/license.txt for BSD license. USING: arrays accessors io io.sockets io.encodings.utf8 io.files io.launcher kernel make mason.config mason.common mason.email -mason.twitter namespaces sequences prettyprint ; +mason.twitter namespaces sequences prettyprint fry ; IN: mason.notify : status-notify ( input-file args -- ) @@ -14,10 +14,12 @@ IN: mason.notify target-cpu get , target-os get , ] { } make prepend - - swap >>command - swap [ +closed+ ] unless* >>stdin - try-output-process + [ 5 ] 2dip '[ + + _ >>command + _ [ +closed+ ] unless* >>stdin + try-output-process + ] retry ] [ 2drop ] if ; : notify-begin-build ( git-id -- )