-
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 registerTodeSharedDir.solo ... still a bit more t…
…ode work to do ... clean up STONES_DATA_HOME definition ... can use customenv to run topaz in stone directory and run solo scripts
- Loading branch information
1 parent
c3853ae
commit 3db2a55
Showing
16 changed files
with
128 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#!/usr/bin/env superdoit_solo | ||
options | ||
{ | ||
SuperDoitRequiredOptionWithRequiredArg long: 'registry'. | ||
SuperDoitRequiredOptionWithRequiredArg long: 'todeSharedDirectory'. | ||
} | ||
% | ||
Usage | ||
----- | ||
USAGE $basename [--help | -h] [--debug | -D] [--debugGem] \ | ||
--registry=<registry-name> --todeSharedDirectory=<path-to-shared-tode-directory> | ||
|
||
DESCRIPTION | ||
Register a tode shared directory for the named registry. If the directory does not | ||
exist the directory is created. tODE images store information that is shared by all | ||
tODE images in the named registry. Necessary for a fully functional tODE stone. | ||
|
||
OPTIONS | ||
-h, --help display usage message | ||
-D, --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. | ||
|
||
EXAMPLES | ||
$basename --help | ||
$basename -D | ||
$basename --registry=bosch --todeSharedDirectory=/home/dhenrich/gemstone/tode_shared | ||
----- | ||
% | ||
specs | ||
[ | ||
RwLoadSpecificationV2 { | ||
#projectName : 'GsDevKit_stones', | ||
#projectSpecFile : 'rowan/project.ston', | ||
#componentNames : [ | ||
'Core', | ||
'Solo' | ||
], | ||
#platformProperties : { | ||
'gemstone' : { | ||
'allusers' : { | ||
#defaultSymbolDictName : 'Globals' | ||
} | ||
} | ||
}, | ||
#comment : '' | ||
} | ||
] | ||
% | ||
doit | ||
| registryClass stonesRegistry todeSharedDir todeSharedDirPath | | ||
self preDoitSpecLoad: [:spec | | ||
spec projectsHome: self dirname asFileReference parent parent]. | ||
registryClass := (self globalNamed: 'GDKRegistry'). | ||
stonesRegistry := registryClass stonesRegistryNamed: self registry. | ||
todeSharedDir := self todeSharedDirectory asFileReference. | ||
todeSharedDir ensureCreateDirectory. | ||
todeSharedDirPath := GsFile serverRealPath: todeSharedDir pathString. | ||
stonesRegistry todeSharedDirectory: todeSharedDirPath. | ||
stonesRegistry export. | ||
|
||
% |
4 changes: 3 additions & 1 deletion
4
src/GsDevKit_stones-Core.package/GDKGsDevKit_stonesBase.class/class/base_data_home.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,5 +1,7 @@ | ||
xdgb accessing | ||
base_data_home | ||
"use super here, because our implementation of _envName:defaultDir: needs to be used" | ||
"use super here, because our implementation of _envName:defaultDir: needs to be used, | ||
since we want the value of $XDG_DATA_HOME / $STONES_DATA_HOME, which does not include | ||
the application name" | ||
|
||
^ super data_home |
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
...it_stones-Core.package/GDKStoneDirectorySpec.class/instance/createTodeSharedDirectory..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 @@ | ||
stone creation | ||
createTodeSharedDirectory: stoneSpec | ||
"noop by default ... see GDKhomeStoneDirectorySpec" |
3 changes: 3 additions & 0 deletions
3
...DevKit_stones-Core.package/GDKStoneDirectorySpec.class/instance/destroyStoneStructure..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 @@ | ||
stone destruction | ||
destroyStoneStructure: stoneSpec | ||
"noop" |
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
10 changes: 6 additions & 4 deletions
10
src/GsDevKit_stones-Core.package/GDKStoneSpec.class/instance/defineCustomEnvVars.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,6 +1,8 @@ | ||
runtime | ||
defineCustomEnvVars | ||
self stoneDirectorySpec customenv | ||
ifNotNil: [ :customenv | | ||
customenv | ||
keysAndValuesDo: [ :varName :valueStr | System gemEnvironmentVariable: varName put: valueStr ] ] | ||
self stoneDirectorySpec | ||
ifNotNil: [ :dirSpec | | ||
dirSpec customenv | ||
ifNotNil: [ :customenv | | ||
customenv | ||
keysAndValuesDo: [ :varName :valueStr | System gemEnvironmentVariable: varName put: valueStr ] ] ] |
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
5 changes: 0 additions & 5 deletions
5
src/GsDevKit_stones-Core.package/GDKStoneSpec.class/instance/registry.st
This file was deleted.
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
src/GsDevKit_stones-Core.package/GDKStoneSpec.class/instance/todeSharedDirectory.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 @@ | ||
accessing | ||
todeSharedDirectory | ||
^ self stonesRegistry todeSharedDirectory |
3 changes: 3 additions & 0 deletions
3
src/GsDevKit_stones-Core.package/GDKStonesRegistry.class/instance/todeSharedDirectory..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 @@ | ||
accessing | ||
todeSharedDirectory: object | ||
todeSharedDirectory := object |
3 changes: 3 additions & 0 deletions
3
src/GsDevKit_stones-Core.package/GDKStonesRegistry.class/instance/todeSharedDirectory.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 @@ | ||
accessing | ||
todeSharedDirectory | ||
^todeSharedDirectory |
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
12 changes: 12 additions & 0 deletions
12
...tones-Core.package/GDKhomeStoneDirectorySpec.class/instance/createTodeSharedDirectory..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,12 @@ | ||
stone creation | ||
createTodeSharedDirectory: stoneSpec | ||
stoneSpec todeSharedDirectory | ||
ifNil: [ | ||
GsFile stdout | ||
nextPutAll: | ||
'WARNING: tode shared directory is not defined, use registerTodeSharedDirectory.solo to define' ] | ||
ifNotNil: [ :todeSharedDirectory | | ||
| todeDir | | ||
todeDir := todeSharedDirectory asFileReference / stoneSpec stoneName. | ||
todeDir ensureCreateDirectory. | ||
self class symbolicLink: todeDir linkName: stoneSpec rootDir / 'tode' ] |
5 changes: 5 additions & 0 deletions
5
...it_stones-Core.package/GDKhomeStoneDirectorySpec.class/instance/destroyStoneStructure..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,5 @@ | ||
stone destruction | ||
destroyStoneStructure: stoneSpec | ||
| todeDir | | ||
todeDir := stoneSpec todeSharedDirectory asFileReference / stoneSpec stoneName. | ||
todeDir ensureDeleteAll |