factor: system:image -> image-path, like vm-path. image is all over the place png, jpg etc

db4
Doug Coleman 2015-07-20 00:17:09 -07:00
parent 4561bd88a3
commit fbbd09f3c5
15 changed files with 25 additions and 25 deletions

View File

@ -129,14 +129,14 @@ DEFER: ?make-staging-image
config [ config [
bootstrap-profile :> profile bootstrap-profile :> profile
vocab "vocab-manifest-" prepend temp-file :> manifest-file vocab "vocab-manifest-" prepend temp-file :> manifest-file
image vocab manifest-file profile deploy-command-line :> flags image-path vocab manifest-file profile deploy-command-line :> flags
profile ?make-staging-image profile ?make-staging-image
vm-path flags run-factor vm-path flags run-factor
manifest-file parse-vocab-manifest-file manifest-file parse-vocab-manifest-file
] with-variables ; ] with-variables ;
:: make-deploy-image-executable ( vm-path image vocab config -- manifest ) :: make-deploy-image-executable ( vm image vocab config -- manifest )
vm-path image vocab config make-deploy-image vm image vocab config make-deploy-image
image vm-path embed-image ; image vm embed-image ;
HOOK: deploy* os ( vocab -- ) HOOK: deploy* os ( vocab -- )

View File

@ -7,7 +7,7 @@ IN: tools.deploy.embed
:: embed-image ( image executable -- ) :: embed-image ( image executable -- )
executable binary <file-appender> [| out | executable binary <file-appender> [| out |
out stream-tell :> offset out stream-tell :> offset
image binary <file-reader> [| in | image-path binary <file-reader> [| in |
in out stream-copy* in out stream-copy*
] with-disposal ] with-disposal
image-magic uintptr_t <ref> out stream-write image-magic uintptr_t <ref> out stream-write

View File

@ -399,7 +399,7 @@ IN: tools.deploy.shaker
output-stream output-stream
error-stream error-stream
vm-path vm-path
image image-path
current-directory current-directory
} % } %

View File

@ -3,6 +3,6 @@
USING: accessors io.streams.c math.parser system ; USING: accessors io.streams.c math.parser system ;
IN: tools.deploy.test.18 IN: tools.deploy.test.18
: main ( -- ) image show ; : main ( -- ) image-path show ;
MAIN: main MAIN: main

View File

@ -18,7 +18,7 @@ IN: ui.backend.cocoa.tools
open-panel [ listener-run-files ] when* ; open-panel [ listener-run-files ] when* ;
: menu-save-image ( -- ) : menu-save-image ( -- )
image save-panel [ save-image ] when* ; image-path save-panel [ save-image ] when* ;
! Handle Open events from the Finder ! Handle Open events from the Finder
CLASS: FactorWorkspaceApplicationDelegate < FactorApplicationDelegate CLASS: FactorWorkspaceApplicationDelegate < FactorApplicationDelegate

View File

@ -48,7 +48,7 @@ load-help? off
run-file run-file
] [ ] [
"Cannot find " write write "." print "Cannot find " write write "." print
"Please move " write image write " into the same directory as the Factor sources," print "Please move " write image-path write " into the same directory as the Factor sources," print
"and try again." print "and try again." print
1 (exit) 1 (exit)
] if ] if

View File

@ -63,7 +63,7 @@ IN: io.files.tests
] unit-test ] unit-test
{ } [ { } [
image binary [ image-path binary [
10 [ 65536 read drop ] times 10 [ 65536 read drop ] times
] with-file-reader ] with-file-reader
] unit-test ] unit-test
@ -135,7 +135,7 @@ CONSTANT: pt-array-1
! Test EOF behavior ! Test EOF behavior
{ 10 } [ { 10 } [
image binary [ image-path binary [
0 read drop 0 read drop
10 read length 10 read length
] with-file-reader ] with-file-reader

View File

@ -79,11 +79,11 @@ PRIVATE>
: init-resource-path ( -- ) : init-resource-path ( -- )
OBJ-ARGS special-object OBJ-ARGS special-object
[ utf8 alien>string "-resource-path=" ?head [ drop f ] unless ] map-find drop [ utf8 alien>string "-resource-path=" ?head [ drop f ] unless ] map-find drop
[ image parent-directory ] unless* "resource-path" set-global ; [ image-path parent-directory ] unless* "resource-path" set-global ;
[ [
cwd current-directory set-global cwd current-directory set-global
OBJ-IMAGE special-object alien>native-string cwd prepend-path \ image set-global OBJ-IMAGE special-object alien>native-string cwd prepend-path \ image-path set-global
OBJ-EXECUTABLE special-object alien>native-string cwd prepend-path \ vm-path set-global OBJ-EXECUTABLE special-object alien>native-string cwd prepend-path \ vm-path set-global
init-resource-path init-resource-path
] "io.files" add-startup-hook ] "io.files" add-startup-hook

View File

@ -129,7 +129,7 @@ HELP: home
} ; } ;
ARTICLE: "io.pathnames.special" "Special pathnames" ARTICLE: "io.pathnames.special" "Special pathnames"
"If a pathname begins with " { $snippet "resource:" } ", it is resolved relative to the directory containing the current image (see " { $link image } ")." "If a pathname begins with " { $snippet "resource:" } ", it is resolved relative to the directory containing the current image (see " { $link image-path } ")."
$nl $nl
"If a pathname begins with " { $snippet "vocab:" } ", then it will be searched for in all current vocabulary roots (see " { $link "add-vocab-roots" } ")." "If a pathname begins with " { $snippet "vocab:" } ", then it will be searched for in all current vocabulary roots (see " { $link "add-vocab-roots" } ")."
$nl $nl

View File

@ -27,4 +27,4 @@ PRIVATE>
: save-image-and-exit ( path -- ) : save-image-and-exit ( path -- )
normalize-path saving-path t (save-image) ; normalize-path saving-path t (save-image) ;
: save ( -- ) image save-image ; : save ( -- ) image-path save-image ;

View File

@ -11,7 +11,7 @@ ARTICLE: "system" "System interface"
"Getting the path to the Factor VM and image:" "Getting the path to the Factor VM and image:"
{ $subsections { $subsections
vm-path vm-path
image image-path
} }
"Getting a monotonically increasing nanosecond count:" "Getting a monotonically increasing nanosecond count:"
{ $subsections nano-count } { $subsections nano-count }
@ -72,7 +72,7 @@ HELP: nano-count
{ $description "Outputs a monotonically increasing count of nanoseconds elapsed since an arbitrary starting time. The difference of two calls to this word allows timing. This word is unaffected by system clock changes." } { $description "Outputs a monotonically increasing count of nanoseconds elapsed since an arbitrary starting time. The difference of two calls to this word allows timing. This word is unaffected by system clock changes." }
{ $notes "This is a low-level word. The " { $vocab-link "tools.time" } " vocabulary defines words to time code execution time." } ; { $notes "This is a low-level word. The " { $vocab-link "tools.time" } " vocabulary defines words to time code execution time." } ;
HELP: image HELP: image-path
{ $values { "path" "a pathname string" } } { $values { "path" "a pathname string" } }
{ $description "Outputs the pathname of the currently running Factor image." } ; { $description "Outputs the pathname of the currently running Factor image." } ;

View File

@ -61,7 +61,7 @@ CONSTANT: string>os-hash H{
PRIVATE> PRIVATE>
: image ( -- path ) \ image get-global ; : image-path ( -- path ) \ image-path get-global ;
: vm-path ( -- path ) \ vm-path get-global ; : vm-path ( -- path ) \ vm-path get-global ;

View File

@ -6,7 +6,7 @@ system ;
IN: contributors IN: contributors
: changelog ( -- authors ) : changelog ( -- authors )
image parent-directory [ image-path parent-directory [
"git log --no-merges --pretty=format:%an" "git log --no-merges --pretty=format:%an"
ascii [ lines ] with-process-reader ascii [ lines ] with-process-reader
] with-directory ; ] with-directory ;

View File

@ -5,7 +5,7 @@ IN: update.latest
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
: git-pull-master ( -- ) : git-pull-master ( -- )
image parent-directory image-path parent-directory
[ [
{ "git" "pull" "git://factorcode.org/git/factor.git" "master" } { "git" "pull" "git://factorcode.org/git/factor.git" "master" }
run-command run-command
@ -22,7 +22,7 @@ IN: update.latest
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
: rebuild-latest ( -- ) : rebuild-latest ( -- )
image parent-directory image-path parent-directory
[ [
backup backup
download-latest-image download-latest-image
@ -35,7 +35,7 @@ IN: update.latest
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
: update-latest ( -- ) : update-latest ( -- )
image parent-directory image-path parent-directory
[ [
git-id git-id
git-pull-master git-pull-master

View File

@ -9,7 +9,7 @@ IN: update
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
: git-pull-clean ( -- ) : git-pull-clean ( -- )
image parent-directory [ image-path parent-directory [
{ "git" "pull" "git://factorcode.org/git/factor.git" branch-name } { "git" "pull" "git://factorcode.org/git/factor.git" branch-name }
run-command run-command
] with-directory ; ] with-directory ;
@ -31,7 +31,7 @@ IN: update
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
: rebuild ( -- ) : rebuild ( -- )
image parent-directory [ image-path parent-directory [
download-clean-image download-clean-image
make-clean make-clean
make make
@ -41,7 +41,7 @@ IN: update
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
: update ( -- ) : update ( -- )
image parent-directory [ image-path parent-directory [
git-id git-id
git-pull-clean git-pull-clean
git-id git-id