 
 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
-SYMBOL: build-status
-
-: build ( -- )
-
-  "running" build-status set-global
-
-  datestamp >stamp
-
-  "/builds/factor" cd
-  
+: git-pull ( -- desc )
   {
     "git"
     "pull"
     "--no-summary"
     "git://factorcode.org/git/factor.git"
     "master"
-  }
-  run-process process-status
-  0 =
-  [ ]
-  [
-    "builder: git pull" email-string
-    "builder: git pull" throw
-  ]
-  if
+  } ;
 
-  {
-    "git" "pull" "--no-summary"
-    "http://dharmatech.onigirihouse.com/factor.git" "master"
-  } run-process drop
+: git-clone ( -- desc ) { "git" "clone" "../factor" } ;
 
-  "/builds/" stamp> append make-directory
-  "/builds/" stamp> append cd
+: enter-build-dir ( -- )
+  datestamp >stamp
+  "/builds" cd
+  stamp> make-directory
+  stamp> cd ;
 
-  { "git" "clone" "../factor" } run-process drop
+: record-git-id ( -- )
+  { "git" "show" } <process-stream> [ readln ] with-stream " " split second
+  "../git-id" log-object ;
 
-  "factor" cd
+: make-clean ( -- desc ) { "make" "clean" } ;
 
-  { "git" "show" } <process-stream> [ readln ] with-stream " " split second
-  "../git-id" log-object
-
-  { "make" "clean" } run-process drop
-
-  ! "vm" build-status set-global
-
+: make-vm ( -- )
   `{
      { +arguments+ { "make" ,[ target ] } }
      { +stdout+    "../compile-log" }
      { +stderr+    +stdout+ }
    }
-  >hashtable run-process process-status
-  0 =
-  [ ]
-  [
-    "builder: vm compile" "../compile-log" email-file
-    "builder: vm compile" throw
-  ] if
+  >hashtable ;
 
+: retrieve-boot-image ( -- )
   [ my-arch download-image ]
   [ ]
   [ "builder: image download" email-string ]
-  cleanup
+  cleanup ;
 
-  ! "bootstrap" build-status set-global
-
+: bootstrap ( -- desc )
   `{
      { +arguments+ {
                      ,[ factor-binary ]

  [ "builder: failing tests" "../failing-tests" email-file ]
  when

  ! "ready" build-status set-global

  ;

! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!



USING: kernel io io.files io.launcher io.sockets hashtables
       system continuations namespaces sequences splitting math.parser
       prettyprint tools.time calendar bake vars http.client
       combinators bootstrap.image bootstrap.image.download
       combinators.cleave ;

IN: builder

