diff --git a/extra/io/unix/launcher/launcher-tests.factor b/extra/io/unix/launcher/launcher-tests.factor index d07ab24da5..88f467385a 100755 --- a/extra/io/unix/launcher/launcher-tests.factor +++ b/extra/io/unix/launcher/launcher-tests.factor @@ -16,4 +16,18 @@ USING: io.unix.launcher tools.test ; [ { "abc def" "hey" } ] [ "'abc def' \"hey\"" tokenize-command ] unit-test [ "'abc def' \"hey" tokenize-command ] unit-test-fails [ "'abc def" tokenize-command ] unit-test-fails -[ { "abc def" "h\"ey" } ] [ "'abc def' \"h\"ey\" " tokenize-command ] unit-test +[ { "abc def" "h\"ey" } ] [ "'abc def' \"h\\\"ey\" " tokenize-command ] unit-test + +[ + { + "Hello world.app/Contents/MacOS/hello-ui" + "-i=boot.macosx-ppc.image" + "-include= math compiler ui" + "-deploy-vocab=hello-ui" + "-output-image=Hello world.app/Contents/Resources/hello-ui.image" + "-no-stack-traces" + "-no-user-init" + } +] [ + "\"Hello world.app/Contents/MacOS/hello-ui\" -i=boot.macosx-ppc.image \"-include= math compiler ui\" -deploy-vocab=hello-ui \"-output-image=Hello world.app/Contents/Resources/hello-ui.image\" -no-stack-traces -no-user-init" tokenize-command +] unit-test diff --git a/extra/io/unix/launcher/launcher.factor b/extra/io/unix/launcher/launcher.factor index ef45a0705e..322bef7e7f 100755 --- a/extra/io/unix/launcher/launcher.factor +++ b/extra/io/unix/launcher/launcher.factor @@ -16,19 +16,18 @@ USE: unix ! "foo bar" -- quotation LAZY: 'escaped-char' "\\" token any-char-parser &> ; -LAZY: 'chars' 'escaped-char' any-char-parser <|> <*> ; +LAZY: 'quoted-char' ( delimiter -- parser' ) + 'escaped-char' + swap [ member? not ] curry satisfy + <|> ; inline -LAZY: 'quoted-1' 'chars' "\"" "\"" surrounded-by ; +LAZY: 'quoted' ( delimiter -- parser ) + dup 'quoted-char' <*> swap dup surrounded-by ; -LAZY: 'quoted-2' 'chars' "'" "'" surrounded-by ; +LAZY: 'unquoted' ( -- parser ) " " 'quoted-char' <+> ; -LAZY: 'non-space-char' - 'escaped-char' [ CHAR: \s = not ] satisfy <|> ; - -LAZY: 'unquoted' 'non-space-char' <+> ; - -LAZY: 'argument' - 'quoted-1' 'quoted-2' 'unquoted' <|> <|> +LAZY: 'argument' ( -- parser ) + "\"" 'quoted' "'" 'quoted' 'unquoted' <|> <|> [ >string ] <@ ; MEMO: 'arguments' ( -- parser ) diff --git a/extra/tools/deploy/deploy.factor b/extra/tools/deploy/deploy.factor index 7c0dabc458..dafe44dfad 100755 --- a/extra/tools/deploy/deploy.factor +++ b/extra/tools/deploy/deploy.factor @@ -26,12 +26,8 @@ IN: tools.deploy [ (copy-lines) ] [ stream-close ] [ ] cleanup ; : stage2 ( vm flags -- ) - [ - "\"" % swap % "\" -i=" % - boot-image-name % - [ " " % % ] each - ] "" make - dup print + >r "-i=" boot-image-name append 2array r> append dup . + dup duplex-stream-out stream-close copy-lines ; @@ -48,11 +44,11 @@ IN: tools.deploy : deploy-command-line ( vm image vocab config -- vm flags ) [ - "\"-include=" swap profile-string "\"" 3append , + "-include=" swap profile-string append , "-deploy-vocab=" swap append , - "\"-output-image=" swap "\"" 3append , + "-output-image=" swap append , "-no-stack-traces" , diff --git a/extra/tools/deploy/macosx/macosx.factor b/extra/tools/deploy/macosx/macosx.factor index a5319563be..7624fbeb9c 100755 --- a/extra/tools/deploy/macosx/macosx.factor +++ b/extra/tools/deploy/macosx/macosx.factor @@ -2,8 +2,9 @@ ! See http://factorcode.org/license.txt for BSD license. USING: io io.files io.launcher kernel namespaces sequences system tools.deploy tools.deploy.config assocs hashtables -prettyprint unix io.unix.backend cocoa cocoa.plists -cocoa.application cocoa.classes ; +prettyprint io.unix.backend cocoa cocoa.plists +cocoa.application cocoa.classes qualified ; +QUALIFIED: unix IN: tools.deploy.macosx : touch ( path -- ) @@ -19,10 +20,13 @@ IN: tools.deploy.macosx bundle-dir over path+ -rot >r "Contents" path+ r> path+ copy-directory ; +: chmod ( path perms -- ) + unix:chmod io-error ; + : copy-vm ( executable bundle-name -- vm ) "Contents/MacOS/" path+ swap path+ vm swap [ copy-file ] keep - [ 755 chmod io-error ] keep ; + [ OCT: 755 chmod ] keep ; : copy-fonts ( name -- ) "fonts/" resource-path