/extra/update/latest/latest.factor

http://github.com/abeaumont/factor · Factor · 51 lines · 35 code · 11 blank · 5 comment · 2 complexity · 946d4c0866a61e62e9aaf66dba8bb899 MD5 · raw file

  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
  4. ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  5. : git-pull-master ( -- )
  6. image parent-directory
  7. [
  8. { "git" "pull" "git://factorcode.org/git/factor.git" "master" }
  9. run-command
  10. ]
  11. with-directory ;
  12. ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  13. : remote-latest-image ( -- url )
  14. { "http://factorcode.org/images/latest/" my-boot-image-name } to-string ;
  15. : download-latest-image ( -- ) remote-latest-image download ;
  16. ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  17. : rebuild-latest ( -- )
  18. image parent-directory
  19. [
  20. backup
  21. download-latest-image
  22. make-clean
  23. make
  24. boot
  25. ]
  26. with-directory ;
  27. ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  28. : update-latest ( -- )
  29. image parent-directory
  30. [
  31. git-id
  32. git-pull-master
  33. git-id
  34. = not
  35. [ rebuild-latest ]
  36. when
  37. ]
  38. with-directory ;
  39. ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  40. MAIN: update-latest