Skip to content

Commit 961b18b

Browse files
authored
Merge pull request #272 from brunobuzzi/issue_260
downloadsHome and productsHome added to AbstractGsDevKitProgram
2 parents 6f00331 + 97189b5 commit 961b18b

File tree

11 files changed

+145
-2
lines changed

11 files changed

+145
-2
lines changed

alt_bin/products.st

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../shared/repos/GsDevKit_launcher/rowan/tonel/gsdevkit_launcher-Scripts/GdkL_Products.class.st
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
other
2+
downloadsHome
3+
4+
^'$GS_HOME/shared/downloads' asFileReference
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
other
2+
productsHome
3+
^ self downloadsHome / 'products'

shared/repos/GsDevKit_launcher/rowan/filetree/gsdevkit_launcher-Scripts.package/GdkL_CopyScriptClasses.class/class/defaultClassNames.st

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ private
22
defaultClassNames
33
"(AbstractGsDevKitProgram subclasses collect: [ :each | each name asString ]) asArray"
44

5-
^ #('GdkL_CopyScriptClasses' 'GdkL_Install_Launcher' 'GdkL_Error' 'GdkL_Hello')
5+
^ #('GdkL_CopyScriptClasses' 'GdkL_Install_Launcher' 'GdkL_Error' 'GdkL_Hello' 'GdkL_Products')
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
USAGE: products [-h]
2+
3+
List downloaded GemStone/S products.
4+
5+
OPTIONS
6+
-h display help
7+
8+
EXAMPLES
9+
products -h
10+
products
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
other
2+
installedProducts
3+
"self new installedProducts"
4+
5+
installedProducts
6+
ifNil: [
7+
installedProducts := Dictionary new.
8+
self productsHome directories
9+
do: [ :productDir |
10+
| dirName |
11+
dirName := productDir basename.
12+
(dirName beginsWith: 'GemStone64Bit')
13+
ifTrue: [
14+
| productVersion dashIndex |
15+
dashIndex := dirName indexOf: $-.
16+
productVersion := dirName copyFrom: 'GemStone64Bit' size + 1 to: dashIndex - 1.
17+
installedProducts at: productVersion put: productDir ]
18+
ifFalse: [
19+
(dirName beginsWith: 'GemBuilderC')
20+
ifTrue: [
21+
| productVersion dashIndex |
22+
dashIndex := dirName indexOf: $-.
23+
productVersion := dirName copyFrom: 'GemBuilderC' size + 1 to: dashIndex - 1.
24+
installedProducts at: productVersion put: productDir ] ] ] ].
25+
^ installedProducts
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
other
2+
installedProductsReportOn: stream
3+
stream
4+
nextPutAll: 'Installed Products:';
5+
cr.
6+
self installedProducts keys sorted
7+
do: [ :gsVers |
8+
stream
9+
tab;
10+
nextPutAll: gsVers;
11+
cr ]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
other
2+
main
3+
4+
self installedProductsReportOn: self stdout
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"category" : "gsdevkit_launcher-Scripts",
3+
"classinstvars" : [
4+
],
5+
"classvars" : [
6+
],
7+
"commentStamp" : "",
8+
"instvars" : [
9+
"installedProducts" ],
10+
"name" : "GdkL_Products",
11+
"pools" : [
12+
],
13+
"super" : "AbstractGsDevKitProgram",
14+
"type" : "normal" }

shared/repos/GsDevKit_launcher/rowan/tonel/gsdevkit_launcher-Scripts/GdkL_CopyScriptClasses.class.st

+2-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ GdkL_CopyScriptClasses class >> copyTonelToFiletree: classNames [
7676
GdkL_CopyScriptClasses class >> defaultClassNames [
7777
"(AbstractGsDevKitProgram subclasses collect: [ :each | each name asString ]) asArray"
7878

79-
^ #('GdkL_CopyScriptClasses' 'GdkL_Install_Launcher' 'GdkL_Error' 'GdkL_Hello')
79+
^ #('GdkL_CopyScriptClasses' 'GdkL_Install_Launcher' 'GdkL_Error' 'GdkL_Hello' 'GdkL_Products')
80+
8081
]
8182

8283
{ #category : 'private' }
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
#!/usr/bin/env gsdevkit_launcher
2+
"
3+
USAGE: products [-h]
4+
5+
List downloaded GemStone/S products.
6+
7+
OPTIONS
8+
-h display help
9+
10+
EXAMPLES
11+
products -h
12+
products
13+
"
14+
Class {
15+
#name : 'GdkL_Products',
16+
#superclass : 'AbstractGsDevKitProgram',
17+
#instVars : [
18+
'installedProducts'
19+
],
20+
#category : 'gsdevkit_launcher-Scripts'
21+
}
22+
23+
{ #category : 'other' }
24+
GdkL_Products >> installedProducts [
25+
"self new installedProducts"
26+
27+
installedProducts
28+
ifNil: [
29+
installedProducts := Dictionary new.
30+
self productsHome directories
31+
do: [ :productDir |
32+
| dirName |
33+
dirName := productDir basename.
34+
(dirName beginsWith: 'GemStone64Bit')
35+
ifTrue: [
36+
| productVersion dashIndex |
37+
dashIndex := dirName indexOf: $-.
38+
productVersion := dirName copyFrom: 'GemStone64Bit' size + 1 to: dashIndex - 1.
39+
installedProducts at: productVersion put: productDir ]
40+
ifFalse: [
41+
(dirName beginsWith: 'GemBuilderC')
42+
ifTrue: [
43+
| productVersion dashIndex |
44+
dashIndex := dirName indexOf: $-.
45+
productVersion := dirName copyFrom: 'GemBuilderC' size + 1 to: dashIndex - 1.
46+
installedProducts at: productVersion put: productDir ] ] ] ].
47+
^ installedProducts
48+
49+
]
50+
51+
{ #category : 'other' }
52+
GdkL_Products >> installedProductsReportOn: stream [
53+
stream
54+
nextPutAll: 'Installed Products:';
55+
cr.
56+
self installedProducts keys sorted
57+
do: [ :gsVers |
58+
stream
59+
tab;
60+
nextPutAll: gsVers;
61+
cr ]
62+
63+
]
64+
65+
{ #category : 'other' }
66+
GdkL_Products >> main [
67+
68+
self installedProductsReportOn: self stdout
69+
70+
]

0 commit comments

Comments
 (0)