From 925750431e65b5ee391f21e5debe6db8329817a9 Mon Sep 17 00:00:00 2001 From: Eduardo Cavazos Date: Sat, 12 Apr 2008 03:08:28 -0500 Subject: [PATCH] builder: move some words to builder.util --- extra/builder/release/release.factor | 61 ++++++++++++++++++++-------- extra/builder/util/util.factor | 5 ++- 2 files changed, 49 insertions(+), 17 deletions(-) diff --git a/extra/builder/release/release.factor b/extra/builder/release/release.factor index 9b449a51c5..665342085b 100644 --- a/extra/builder/release/release.factor +++ b/extra/builder/release/release.factor @@ -1,6 +1,6 @@ USING: kernel system namespaces sequences splitting combinators - io io.files io.launcher prettyprint + io io.files io.launcher prettyprint bootstrap.image bake combinators.cleave builder.common builder.util ; IN: builder.release @@ -33,10 +33,6 @@ IN: builder.release ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -: cpu- ( -- cpu ) cpu unparse "." split "-" join ; - -! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - : base-name ( -- string ) { "factor" [ os unparse ] cpu- stamp> } to-strings "-" join ; @@ -89,8 +85,6 @@ IN: builder.release SYMBOL: upload-to-factorcode -: platform ( -- string ) { [ os unparse ] cpu- } to-strings "-" join ; - : remote-location ( -- dest ) "factorcode.org:/var/www/factorcode.org/newsite/downloads" platform @@ -101,24 +95,59 @@ SYMBOL: upload-to-factorcode [ "Error uploading binary to factorcode" print ] run-or-bail ; +! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + : maybe-upload ( -- ) upload-to-factorcode get [ upload ] when ; ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +! update-clean-branch +! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -! : release ( -- ) -! "factor" -! [ -! remove-factor-app -! remove-common-files -! ] -! with-directory -! make-archive -! archive-name releases move-file-into ; +: branch-name ( -- string ) + { "clean" [ os unparse ] cpu- } to-strings "-" join ; + +: refspec ( -- string ) "master:" branch-name append ; + +: push-to-clean-branch ( -- ) + { "git" "push" "factorcode.org:/git/factor.git" refspec } + to-strings + try-process ; + +! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +: upload-clean-image ( -- ) + { + "scp" + my-boot-image-name + "factorcode.org:/var/www/factorcode.org/newsite/images/clean" + } + to-strings + try-process ; + +! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +: update-clean-branch ( -- ) + "factor" + [ + push-to-clean-branch + upload-clean-image + ] + with-directory ; + +! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +: maybe-update-clean-branch ( -- ) + upload-to-factorcode get + [ update-clean-branch ] + when ; + +! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! : release ( -- ) + maybe-update-clean-branch "factor" [ remove-factor-app diff --git a/extra/builder/util/util.factor b/extra/builder/util/util.factor index 629a713ad9..e80d83e24c 100644 --- a/extra/builder/util/util.factor +++ b/extra/builder/util/util.factor @@ -2,6 +2,7 @@ USING: kernel words namespaces classes parser continuations io io.files io.launcher io.sockets math math.parser + system combinators sequences splitting quotations arrays strings tools.time sequences.deep accessors assocs.lib io.encodings.utf8 @@ -94,4 +95,6 @@ USE: prettyprint ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -: failsafe ( quot -- ) [ drop ] recover ; +: cpu- ( -- cpu ) cpu unparse "." split "-" join ; + +: platform ( -- string ) { [ os unparse ] cpu- } to-strings "-" join ; \ No newline at end of file