diff --git a/extra/mason/common/common.factor b/extra/mason/common/common.factor index db68a558e0..5e37a683cf 100644 --- a/extra/mason/common/common.factor +++ b/extra/mason/common/common.factor @@ -57,6 +57,7 @@ M: unix really-delete-tree delete-tree ; [ day>> , ] [ hour>> , ] [ minute>> , ] + [ drop nano-count , ] } cleave ] { } make [ pad-00 ] map "-" join ; diff --git a/extra/mason/updates/updates.factor b/extra/mason/updates/updates.factor index 60a155eae7..57a8c748d2 100644 --- a/extra/mason/updates/updates.factor +++ b/extra/mason/updates/updates.factor @@ -1,9 +1,17 @@ ! Copyright (C) 2008, 2010 Eduardo Cavazos, Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: kernel io.launcher bootstrap.image.download -mason.common mason.platform ; +USING: bootstrap.image.download combinators.short-circuit +io.directories io.launcher kernel mason.common mason.platform ; IN: mason.updates +: git-reset-cmd ( -- cmd ) + { + "git" + "reset" + "--hard" + "HEAD" + } ; + : git-pull-cmd ( -- cmd ) { "git" @@ -14,6 +22,8 @@ IN: mason.updates } ; : updates-available? ( -- ? ) + ".git/index" delete-file + git-reset-cmd short-running-process git-id git-pull-cmd short-running-process git-id @@ -23,6 +33,4 @@ IN: mason.updates boot-image-name maybe-download-image ; : new-code-available? ( -- ? ) - updates-available? - new-image-available? - or ; \ No newline at end of file + { [ updates-available? ] [ new-image-available? ] } 0|| ;