factor/extra/update/update.factor

56 lines
1.6 KiB
Factor
Raw Normal View History

USING: kernel system sequences io.files io.directories
io.pathnames io.launcher bootstrap.image http.client update.util ;
2008-11-10 20:20:08 -05:00
IN: update
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
: run-command ( cmd -- ) to-strings try-process ;
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
: git-pull-clean ( -- )
image-path parent-directory [
2013-07-24 17:52:09 -04:00
{ "git" "pull" "git://factorcode.org/git/factor.git" branch-name }
run-command
] with-directory ;
2008-11-10 20:20:08 -05:00
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
: remote-clean-image ( -- url )
2013-07-24 17:52:09 -04:00
{ "http://factorcode.org/images/clean/" platform "/" my-boot-image-name }
to-string ;
2008-11-10 20:20:08 -05:00
: download-clean-image ( -- ) remote-clean-image download ;
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
: make-clean ( -- ) { gnu-make "clean" } run-command ;
: make ( -- ) { gnu-make } run-command ;
: boot ( -- ) { "./factor" { "-i=" my-boot-image-name } } run-command ;
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
: rebuild ( -- )
image-path parent-directory [
2013-07-24 17:52:09 -04:00
download-clean-image
make-clean
make
boot
] with-directory ;
2008-11-10 20:20:08 -05:00
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
: update ( -- )
image-path parent-directory [
2013-07-24 17:52:09 -04:00
git-id
git-pull-clean
git-id
= not
2008-11-10 20:20:08 -05:00
[ rebuild ]
2013-07-24 17:52:09 -04:00
when
] with-directory ;
2008-11-10 20:20:08 -05:00
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2013-07-24 17:52:09 -04:00
MAIN: update