Merge branch 'master' of git://factorcode.org/git/factor
[factor/jcg.git] / extra / update / latest / latest.factor
blob77cd184cdb992d9d69f1d54c8865184d72b0e992
1 USING: kernel namespaces system io.files io.pathnames io.directories
2 bootstrap.image http.client update update.backup update.util ;
3 IN: update.latest
5 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7 : git-pull-master ( -- )
8   image parent-directory
9     [
10       { "git" "pull" "git://factorcode.org/git/factor.git" "master" }
11       run-command
12     ]
13   with-directory ;
15 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
17 : remote-latest-image ( -- url )
18   { "http://factorcode.org/images/latest/" my-boot-image-name } to-string ;
20 : download-latest-image ( -- ) remote-latest-image download ;
22 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
24 : rebuild-latest ( -- )
25   image parent-directory
26     [
27       backup
28       download-latest-image
29       make-clean
30       make
31       boot
32     ]
33   with-directory ;
35 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
37 : update-latest ( -- )
38   image parent-directory
39     [
40       git-id
41       git-pull-master
42       git-id
43       = not
44         [ rebuild-latest ]
45       when
46     ]
47   with-directory ;
49 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
51 MAIN: update-latest