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