]> gitweb.factorcode.org Git - factor.git/blob - extra/update/update.factor
c6a5671345c95b8d0c3d63e9438cc955d6afff4f
[factor.git] / extra / update / update.factor
1
2 USING: kernel system sequences io.files io.launcher bootstrap.image
3        http.client
4        update.util ;
5
6        ! builder.util builder.release.branch ;
7
8 IN: update
9
10 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
11
12 : run-command ( cmd -- ) to-strings try-process ;
13
14 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
15
16 : git-pull-clean ( -- )
17   image parent-directory
18     [
19       { "git" "pull" "git://factorcode.org/git/factor.git" branch-name }
20       run-command
21     ]
22   with-directory ;
23
24 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
25
26 : remote-clean-image ( -- url )
27   { "http://factorcode.org/images/clean/" platform "/" my-boot-image-name }
28   to-string ;
29
30 : download-clean-image ( -- ) remote-clean-image download ;
31
32 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
33
34 : make-clean ( -- ) { gnu-make "clean" } run-command ;
35 : make       ( -- ) { gnu-make         } run-command ;
36 : boot       ( -- ) { "./factor" { "-i=" my-boot-image-name } } run-command ;
37
38 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
39
40 : rebuild ( -- )
41   image parent-directory
42     [
43       download-clean-image
44       make-clean
45       make
46       boot
47     ]
48   with-directory ;
49
50 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
51
52 : update ( -- )
53   image parent-directory
54     [
55       git-id
56       git-pull-clean
57       git-id
58       = not
59         [ rebuild ]
60       when
61     ]
62   with-directory ;
63
64 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
65
66 MAIN: update