1 ! Copyright (C) 2008, 2010 Eduardo Cavazos, Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: bootstrap.image.download http.client init kernel
4 math.parser namespaces mason.config mason.common mason.git
8 TUPLE: sources git-id boot-image counter ;
12 SYMBOLS: latest-sources last-built-sources ;
15 f latest-sources set-global
16 f last-built-sources set-global
17 ] "mason.updates" add-startup-hook
19 : latest-boot-image ( -- boot-image )
21 [ maybe-download-image drop ] [ file-checksum ] bi ;
23 : latest-counter ( -- counter )
24 counter-url get-global http-get nip string>number ;
26 : update-sources ( -- )
27 #! Must be run from builds-dir
28 git-pull latest-boot-image latest-counter <sources>
29 latest-sources set-global ;
32 latest-sources get-global last-built-sources get-global = not ;
35 #! If the build completed (successfully or not) without
36 #! mason crashing or being killed, don't build this git ID
37 #! and boot image hash again.
38 latest-sources get-global last-built-sources set-global ;