--- a/OSProcess.st Thu Apr 14 10:24:54 2011 +0200
+++ b/OSProcess.st Fri Apr 15 17:44:08 2011 +0200
@@ -1,3 +1,4 @@
+"{ NameSpace: SVN }"
"{ Package: 'stx:libsvn' }"
Object subclass:#OSProcess
@@ -17,32 +18,32 @@
aString := anObject asString.
(aString first = $' and: [aString last = $'])
- ifTrue:[^aString].
+ ifTrue:[^aString].
(aString first = $" and: [aString last = $"])
- ifTrue:[^aString].
+ ifTrue:[^aString].
(aString allSatisfy:
- [:char|char isSeparator not and: [(#($" $< $> $& $# $; $\) includes: char) not]])
- ifTrue:[^aString].
+ [:char|char isSeparator not and: [(#($" $< $> $& $# $; $\) includes: char) not]])
+ ifTrue:[^aString].
unquotedStream := aString readStream.
quotedStream := (String new: aString size + 10) writeStream.
quotedStream nextPut: $".
[ unquotedStream atEnd ] whileFalse:
- [|char|
- char := unquotedStream next.
- (#($" $\) includes: char) ifTrue:[quotedStream nextPut: $\].
- quotedStream nextPut: char].
+ [|char|
+ char := unquotedStream next.
+ (#($" $\) includes: char) ifTrue:[quotedStream nextPut: $\].
+ quotedStream nextPut: char].
quotedStream nextPut: $".
^quotedStream contents.
"
- OSProcess asShellQuotedArgument: 'Hello' .
- OSProcess asShellQuotedArgument: 'Hello world'
- OSProcess asShellQuotedArgument: 'Hello'' world'
- OSProcess asShellQuotedArgument: 'Hello
- World'
+ OSProcess asShellQuotedArgument: 'Hello' .
+ OSProcess asShellQuotedArgument: 'Hello world'
+ OSProcess asShellQuotedArgument: 'Hello'' world'
+ OSProcess asShellQuotedArgument: 'Hello
+ World'
"
"Created: / 10-10-2008 / 12:32:18 / Jan Vrany <vranyj1@fel.cvut.cz>"
@@ -153,9 +154,9 @@
cmdStream := String new writeStream.
cmdStream nextPutAll:self executable.
self arguments do:
- [:arg|
- cmdStream space.
- cmdStream nextPutAll:(self asShellQuotedArgument: arg)].
+ [:arg|
+ cmdStream space.
+ cmdStream nextPutAll:(self asShellQuotedArgument: arg)].
^cmdStream contents utf8Encoded
@@ -169,21 +170,21 @@
execute
"
self synchronized:
- [runningLock
- ifNotNil:[self error:'Process already running']
- ifNil:[runningLock := Semaphore new:0]].
+ [runningLock
+ ifNotNil:[self error:'Process already running']
+ ifNil:[runningLock := Semaphore new:0]].
[["
- (OperatingSystem
- executeCommand: self asShellCommandString
- inputFrom: self stdin
- outputTo: self stdout
- errorTo: self stderr
- auxFrom: nil
- environment: nil
- inDirectory: self workdir asString
- lineWise: (self stdout = self stderr)
- onError:[:value|exitValue := value code.false])
- ifTrue:[exitValue := 0]
+ (OperatingSystem
+ executeCommand: self asShellCommandString
+ inputFrom: self stdin
+ outputTo: self stdout
+ errorTo: self stderr
+ auxFrom: nil
+ environment: nil
+ inDirectory: self workdir asString
+ lineWise: (self stdout = self stderr)
+ onError:[:value|exitValue := value code.false])
+ ifTrue:[exitValue := 0]
"
] ensure:[runningLock signalForAll. runningLock := nil]] fork
"
@@ -197,9 +198,9 @@
"| lock |
self synchronized:
- [runningLock
- ifNil:[^self]
- ifNotNil:[lock := runningLock]].
+ [runningLock
+ ifNil:[^self]
+ ifNotNil:[lock := runningLock]].
lock wait"
"Created: / 15-03-2008 / 18:32:41 / janfrog"