-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #4: implement stopNetldi.solo ... tweaking
- Loading branch information
1 parent
1a84d16
commit 2295395
Showing
14 changed files
with
226 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
#!/usr/bin/env superdoit_solo | ||
options | ||
{ | ||
SuperDoitOptionalOptionWithRequiredArg long: 'registry'. | ||
SuperDoitOptionalOptionWithNoArg long: 'verbose'. | ||
} | ||
% | ||
Usage | ||
----- | ||
USAGE $basename [--help] [--debug] [--debugGem] [--verbose] \ | ||
--registry=<registry-name> <stone-name> | ||
|
||
DESCRIPTION | ||
Stop netldi for named stone. | ||
|
||
OPTIONS | ||
--help display usage message | ||
--debug bring up topaz debugger in the event of a script error | ||
--debugGem If terminal is connected to stdout, bring up debugger. If not, | ||
dump stack to stdout and wait for topaz to attach using topaz | ||
DEBUGGEM command. | ||
--verbose Verbose logging enabled. | ||
|
||
EXAMPLES | ||
$basename --help | ||
$basename --debug | ||
$basename --debugGem | ||
$basename --registry=bosch bosch_370 | ||
# if launched from stone directory where .GDKStoneSpec.ston is present | ||
$basename | ||
----- | ||
% | ||
specs | ||
[ | ||
RwLoadSpecificationV2 { | ||
#projectName : 'GsDevKit_stones', | ||
#projectSpecFile : 'rowan/project.ston', | ||
#componentNames : [ | ||
'Core', | ||
'Solo' | ||
], | ||
#platformProperties : { | ||
'gemstone' : { | ||
'allusers' : { | ||
#defaultSymbolDictName : 'Globals' | ||
} | ||
} | ||
}, | ||
#comment : '' | ||
}, | ||
RwLoadSpecificationV2 { | ||
#projectName : 'GsCommands', | ||
#projectSpecFile : 'rowan/project.ston', | ||
#diskUrl : '$GEMSTONE/examples/GsCommands/projectsHome/GsCommands', | ||
#componentNames : [ | ||
'Commands' | ||
], | ||
#platformProperties : { | ||
'gemstone' : { | ||
'allusers' : { | ||
#defaultSymbolDictName : 'UserGlobals' | ||
} | ||
} | ||
}, | ||
#comment : '' | ||
} | ||
] | ||
% | ||
doit | ||
| registryClass stonesRegistry stoneName stoneSpec | | ||
self preDoitSpecLoad: [:spec | | ||
spec projectName = 'GsCommands' | ||
ifTrue: [ spec projectsHome: '$GEMSTONE/examples/GsCommands/projectsHome' ] | ||
ifFalse: [ spec projectsHome: self dirname asFileReference parent parent ] ]. | ||
registryClass := (self globalNamed: 'GDKRegistry'). | ||
self verbose | ||
ifTrue: [ (self globalNamed: 'GDKGsDevKit_stonesBase') verbose: true ]. | ||
self positionalArgs size = 0 | ||
ifTrue: [ | ||
| specFile | | ||
specFile := FileLocator workingDirectory asFileReference / '.GDKStoneSpec.ston'. | ||
stoneSpec := (self globalNamed: 'GDKAbstractRegistryStore') fromPath: specFile ifAbsent: [] ] | ||
ifFalse: [ | ||
self positionalArgs size > 1 | ||
ifTrue: [ self error: 'Expected a single positional argument: <stone-name>, not ', self positionalArgs size printString, ' positional arguments' ]. | ||
stoneName := self positionalArgs at: 1. | ||
self registry | ||
ifNil: [ self error: '--registry option must be specified when <stone-name> is specified' ]. | ||
stonesRegistry := registryClass stonesRegistryNamed: self registry. | ||
stoneSpec := stonesRegistry stoneNamed: stoneName ]. | ||
stoneSpec stopNetldi: self withSuperDoitOptions: true. | ||
^ self noResult | ||
% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 0 additions & 3 deletions
3
src/GsDevKit_stones-Core.package/GDKStoneSpec.class/instance/startNetldi..st
This file was deleted.
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
src/GsDevKit_stones-Core.package/GDKStoneSpec.class/instance/startNetldi.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
runtime | ||
startNetldi | ||
self startNetldi: nil withSuperDoitOptions: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 0 additions & 4 deletions
4
src/GsDevKit_stones-Core.package/GDKStoneSpec.class/instance/startStone..st
This file was deleted.
Oops, something went wrong.
4 changes: 4 additions & 0 deletions
4
src/GsDevKit_stones-Core.package/GDKStoneSpec.class/instance/startStone.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
runtime | ||
startStone | ||
|
||
self startStone: nil withSuperDoitOptions: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
src/GsDevKit_stones-Core.package/GDKStoneSpec.class/instance/stopNetldi.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
runtime | ||
stopNetldi | ||
self stopNetldi: nil withSuperDoitOptions: false |
52 changes: 52 additions & 0 deletions
52
...evKit_stones-Core.package/GDKStoneSpec.class/instance/stopNetldi.withSuperDoitOptions..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
runtime | ||
stopNetldi: superDoitScriptOrNil withSuperDoitOptions: superDoitOptionsBoolean | ||
"if superDoitOptionsBoolean is true, then superDoitScriptOrNil is expected to respond to the following messages: | ||
debugLogging | ||
restart" | ||
|
||
| scriptPath stdout exitStatus commandLine arrayOfOutputs | | ||
scriptPath := ''. | ||
stdout := superDoitScriptOrNil | ||
ifNotNil: [ | ||
scriptPath := superDoitScriptOrNil scriptPath. | ||
superDoitScriptOrNil stdout ] | ||
ifNil: [ GsFile stdout ]. | ||
stdout | ||
lf; | ||
nextPutAll: '====== stopping netldi at ' , DateAndTime now printString; | ||
lf. | ||
exitStatus := 0. | ||
self defineCustomEnvVars. | ||
commandLine := '$GEMSTONE/bin/stopnetldi' asFileReference pathString. | ||
commandLine | ||
add: ' ' , self stoneName , '_ldi'; | ||
yourself. | ||
GDKGsDevKit_stonesBase verbose | ||
ifTrue: [ | ||
stdout | ||
lf; | ||
nextPutAll: commandLine; | ||
yourself ]. | ||
[ arrayOfOutputs := GsHostProcess execute: commandLine ] | ||
on: ChildError | ||
do: [ :ex | | ||
"exit status: | ||
0 on successful stop | ||
1 if the specified netldi was not running | ||
3 or above, an error occurred and the specified netldi could not be stopped" | ||
exitStatus := ex status ]. | ||
exitStatus = 0 | ||
ifTrue: [ stdout nextPutAll: (arrayOfOutputs at: 1) "stdout" ] | ||
ifFalse: [ | ||
exitStatus = 1 | ||
ifTrue: [ stdout nextPutAll: 'netldi was not running (' , exitStatus printString , ')' ] | ||
ifFalse: [ | ||
exitStatus >= 3 | ||
ifTrue: [ | ||
stdout | ||
nextPutAll: | ||
'netldi could not be stopped (' , exitStatus printString , ')' ] ] ]. | ||
stdout | ||
lf; | ||
nextPutAll: '****************************************'; | ||
lf |
3 changes: 0 additions & 3 deletions
3
src/GsDevKit_stones-Core.package/GDKStoneSpec.class/instance/stopStone..st
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
src/GsDevKit_stones-Core.package/GDKStoneSpec.class/instance/stopStone.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
runtime | ||
stopStone | ||
self stopStone: nil | ||
self stopStone: nil withSuperDoitOptions: false |