Merge branch 'master' of git://factorcode.org/git/factor

db4
John Benediktsson 2008-11-10 18:13:51 -08:00
commit 075f44a803
4 changed files with 67 additions and 3 deletions

View File

@ -1,5 +1,5 @@
USING: namespaces debugger io.files bootstrap.image builder.util ;
USING: namespaces debugger io.files bootstrap.image update.util ;
IN: update.backup

View File

@ -1,6 +1,6 @@
USING: kernel namespaces system io.files bootstrap.image http.client
builder.util update update.backup ;
update update.backup update.util ;
IN: update.latest

View File

@ -1,7 +1,9 @@
USING: kernel system sequences io.files io.launcher bootstrap.image
http.client
builder.util builder.release.branch ;
update.util ;
! builder.util builder.release.branch ;
IN: update

View File

@ -0,0 +1,62 @@
USING: kernel classes strings quotations words math math.parser arrays
combinators.cleave
accessors
system prettyprint splitting
sequences combinators sequences.deep
io
io.launcher
io.encodings.utf8
calendar
calendar.format ;
IN: update.util
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
DEFER: to-strings
: to-string ( obj -- str )
dup class
{
{ \ string [ ] }
{ \ quotation [ call ] }
{ \ word [ execute ] }
{ \ fixnum [ number>string ] }
{ \ array [ to-strings concat ] }
}
case ;
: to-strings ( seq -- str )
dup [ string? ] all?
[ ]
[ [ to-string ] map flatten ]
if ;
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
: cpu- ( -- cpu ) cpu unparse "." split "-" join ;
: platform ( -- string ) { [ os unparse ] cpu- } to-strings "-" join ;
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
: branch-name ( -- string ) "clean-" platform append ;
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
: gnu-make ( -- string )
os { freebsd openbsd netbsd } member? [ "gmake" ] [ "make" ] if ;
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
: git-id ( -- id )
{ "git" "show" } utf8 <process-reader> [ readln ] with-input-stream
" " split second ;
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
: datestamp ( -- string )
now
{ year>> month>> day>> hour>> minute>> } <arr>
[ pad-00 ] map "-" join ;