mason: add retries in another place, and add a type declaration

Slava Pestov 2009-05-10 16:40:19 -05:00
parent cd64833360
commit 59c7e881da
2 changed files with 9 additions and 7 deletions

View File

@ -5,12 +5,12 @@ math.functions make io io.files io.pathnames io.directories
io.directories.hierarchy io.launcher io.encodings.utf8 prettyprint io.directories.hierarchy io.launcher io.encodings.utf8 prettyprint
combinators.short-circuit parser combinators calendar combinators.short-circuit parser combinators calendar
calendar.format arrays mason.config locals system debugger fry calendar.format arrays mason.config locals system debugger fry
continuations ; continuations strings ;
IN: mason.common IN: mason.common
SYMBOL: current-git-id SYMBOL: current-git-id
ERROR: output-process-error output process ; ERROR: output-process-error { output string } { process process } ;
M: output-process-error error. M: output-process-error error.
[ "Process:" print process>> . nl ] [ "Process:" print process>> . nl ]

View File

@ -2,7 +2,7 @@
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: arrays accessors io io.sockets io.encodings.utf8 io.files USING: arrays accessors io io.sockets io.encodings.utf8 io.files
io.launcher kernel make mason.config mason.common mason.email io.launcher kernel make mason.config mason.common mason.email
mason.twitter namespaces sequences prettyprint ; mason.twitter namespaces sequences prettyprint fry ;
IN: mason.notify IN: mason.notify
: status-notify ( input-file args -- ) : status-notify ( input-file args -- )
@ -14,10 +14,12 @@ IN: mason.notify
target-cpu get , target-cpu get ,
target-os get , target-os get ,
] { } make prepend ] { } make prepend
<process> [ 5 ] 2dip '[
swap >>command <process>
swap [ +closed+ ] unless* >>stdin _ >>command
try-output-process _ [ +closed+ ] unless* >>stdin
try-output-process
] retry
] [ 2drop ] if ; ] [ 2drop ] if ;
: notify-begin-build ( git-id -- ) : notify-begin-build ( git-id -- )