1 ! Copyright (C) 2008 Eduardo Cavazos, Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: kernel namespaces sequences splitting system accessors
4 math.functions make io io.files io.launcher io.encodings.utf8
5 prettyprint combinators.short-circuit parser combinators
6 calendar calendar.format arrays mason.config locals ;
9 : short-running-process ( command -- )
10 #! Give network operations at most 15 minutes to complete.
16 :: upload-safely ( local username host remote -- )
17 [let* | temp [ remote ".incomplete" append ]
18 scp-remote [ { username "@" host ":" temp } concat ]
19 scp [ scp-command get ]
20 ssh [ ssh-command get ] |
21 { scp local scp-remote } short-running-process
22 { ssh host "-l" username "mv" temp remote } short-running-process
25 : eval-file ( file -- obj )
26 dup utf8 file-lines parse-fresh
27 [ "Empty file: " swap append throw ] [ nip first ] if-empty ;
29 : cat ( file -- ) utf8 file-contents print ;
31 : cat-n ( file n -- ) [ utf8 file-lines ] dip short tail* [ print ] each ;
33 : to-file ( object file -- ) utf8 [ . ] with-file-writer ;
35 : datestamp ( timestamp -- string )
44 ] { } make [ pad-00 ] map "-" join ;
46 : milli-seconds>time ( n -- string )
48 [ hour>> ] [ minute>> ] [ second>> floor ] tri 3array
49 [ pad-00 ] map ":" join ;
53 : builds/factor ( -- path ) builds-dir get "factor" append-path ;
54 : build-dir ( -- path ) builds-dir get stamp get append-path ;
56 : prepare-build-machine ( -- )
57 builds-dir get make-directories
59 [ { "git" "clone" "git://factorcode.org/git/factor.git" } try-process ]
63 { "git" "show" } utf8 [ readln ] with-process-reader
66 : ?prepare-build-machine ( -- )
67 builds/factor exists? [ prepare-build-machine ] unless ;
69 : load-everything-vocabs-file "load-everything-vocabs" ;
70 : load-everything-errors-file "load-everything-errors" ;
72 : test-all-vocabs-file "test-all-vocabs" ;
73 : test-all-errors-file "test-all-errors" ;
75 : help-lint-vocabs-file "help-lint-vocabs" ;
76 : help-lint-errors-file "help-lint-errors" ;
78 : boot-time-file "boot-time" ;
79 : load-time-file "load-time" ;
80 : compiler-errors-file "compiler-errors" ;
81 : test-time-file "test-time" ;
82 : help-lint-time-file "help-lint-time" ;
83 : benchmark-time-file "benchmark-time" ;
84 : html-help-time-file "html-help-time" ;
86 : benchmarks-file "benchmarks" ;
90 SYMBOL: status-error ! didn't bootstrap, or crashed
91 SYMBOL: status-dirty ! bootstrapped but not all tests passed
92 SYMBOL: status-clean ! everything good