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