--- a/Class.st Fri Mar 05 18:50:51 2004 +0100
+++ b/Class.st Fri Mar 05 18:51:21 2004 +0100
@@ -4142,11 +4142,11 @@
(this is done for backward compatibility,)
For example:
- '....(libbasic)' -> module: stx directory: libbasic library: libbasic
- '....(stx:libbasic)' -> module: stx directory: libbasic library: libbasic
- '....(stx:foo:libbfoo)' -> module: stx directory: foo library: libfoo
- '....(aeg:libIECInterface)' -> module: aeg directory: libIECInterface library:libIECInterface
- '....(stx:goodies/persistency:libdbase)' -> module: stx directory: goodies/persistency library:libdbase
+ '....(libbasic)' -> module: stx directory: libbasic library: libbasic
+ '....(stx:libbasic)' -> module: stx directory: libbasic library: libbasic
+ '....(stx:foo:libbfoo)' -> module: stx directory: foo library: libfoo
+ '....(aeg:libIECInterface)' -> module: aeg directory: libIECInterface library:libIECInterface
+ '....(stx:goodies/persistency:libdbase)' -> module: stx directory: goodies/persistency library:libdbase
The way how the sourceCodeManager uses this to find the source location
depends on the scheme used. For CVS, the module is taken as the -d arg,
@@ -4154,7 +4154,7 @@
Other schemes may do things differently - these are not yet specified.
Caveat:
- Encoding this info in the package string seems somewhat kludgy.
+ Encoding this info in the package string seems somewhat kludgy.
"
|owner sourceInfo packageString idx1 idx2
@@ -4163,16 +4163,17 @@
(owner := self owningClass) notNil ifTrue:[^ owner packageSourceCodeInfo].
package isNil ifTrue:[^ nil].
+ package == (Project noProjectID) ifTrue:[^ nil].
packageString := package asString.
idx1 := packageString lastIndexOf:$(.
idx1 ~~ 0 ifTrue:[
- idx2 := packageString indexOf:$) startingAt:idx1+1.
- idx2 ~~ 0 ifTrue:[
- sourceInfo := packageString copyFrom:idx1 + 1 to:idx2 - 1
- ]
+ idx2 := packageString indexOf:$) startingAt:idx1+1.
+ idx2 ~~ 0 ifTrue:[
+ sourceInfo := packageString copyFrom:idx1 + 1 to:idx2 - 1
+ ]
] ifFalse:[
- sourceInfo := packageString
+ sourceInfo := packageString
].
sourceInfo isNil ifTrue:[^ nil].
@@ -4180,77 +4181,77 @@
components size == 0 ifTrue:[
"/ moduleString := 'stx'.
"/ directoryString := libraryString := ''.
- ^ nil
+ ^ nil
].
component1 := components at:1.
components size == 1 ifTrue:[
- "/ a single name given - the module becomes 'stx' or
- "/ the very first directory component (if such a module exists).
- "/ If the component includes slashes, its the directory
- "/ otherwise the library.
- "/
- dirComponents := Filename concreteClass components:component1.
- (dirComponents size > 1
- and:[(mgr := self sourceCodeManager) notNil
- and:[mgr checkForExistingModule:dirComponents first]]) ifTrue:[
- moduleString := dirComponents first.
- directoryString := libraryString := (Filename fromComponents:(dirComponents copyFrom:2)) asString.
- ] ifFalse:[
- "/ non-existing; assume directory under the stx package.
- moduleString := 'stx'.
- (component1 startsWith:'stx/') ifTrue:[
- component1 := component1 copyFrom:5
- ].
- directoryString := libraryString := component1.
- ].
-
- (libraryString includes:$/) ifTrue:[
- libraryString := libraryString asFilename baseName
- ]
+ "/ a single name given - the module becomes 'stx' or
+ "/ the very first directory component (if such a module exists).
+ "/ If the component includes slashes, its the directory
+ "/ otherwise the library.
+ "/
+ dirComponents := Filename concreteClass components:component1.
+ (dirComponents size > 1
+ and:[(mgr := self sourceCodeManager) notNil
+ and:[mgr checkForExistingModule:dirComponents first]]) ifTrue:[
+ moduleString := dirComponents first.
+ directoryString := libraryString := (Filename fromComponents:(dirComponents copyFrom:2)) asString.
+ ] ifFalse:[
+ "/ non-existing; assume directory under the stx package.
+ moduleString := 'stx'.
+ (component1 startsWith:'stx/') ifTrue:[
+ component1 := component1 copyFrom:5
+ ].
+ directoryString := libraryString := component1.
+ ].
+
+ (libraryString includes:$/) ifTrue:[
+ libraryString := libraryString asFilename baseName
+ ]
] ifFalse:[
- component2 := components at:2.
- components size == 2 ifTrue:[
- "/ two components - assume its the module and the directory;
- "/ the library is assumed to be named after the directory
- "/ except, if slashes are in the name; then the libraryname
- "/ is the last component.
- "/
- moduleString := component1.
- directoryString := libraryString := component2.
- (libraryString includes:$/) ifTrue:[
- libraryString := libraryString asFilename baseName
- ]
- ] ifFalse:[
- "/ all components given
- moduleString := component1.
- directoryString := component2.
- libraryString := components at:3.
- ]
+ component2 := components at:2.
+ components size == 2 ifTrue:[
+ "/ two components - assume its the module and the directory;
+ "/ the library is assumed to be named after the directory
+ "/ except, if slashes are in the name; then the libraryname
+ "/ is the last component.
+ "/
+ moduleString := component1.
+ directoryString := libraryString := component2.
+ (libraryString includes:$/) ifTrue:[
+ libraryString := libraryString asFilename baseName
+ ]
+ ] ifFalse:[
+ "/ all components given
+ moduleString := component1.
+ directoryString := component2.
+ libraryString := components at:3.
+ ]
].
libraryString isEmpty ifTrue:[
- directoryString notEmpty ifTrue:[
- libraryString := directoryString asFilename baseName
- ].
- libraryString isEmpty ifTrue:[
- "/ lets extract the library from the liblist file ...
- libraryString := Smalltalk libraryFileNameOfClass:self.
- libraryString isNil ifTrue:[^ nil].
- ]
+ directoryString notEmpty ifTrue:[
+ libraryString := directoryString asFilename baseName
+ ].
+ libraryString isEmpty ifTrue:[
+ "/ lets extract the library from the liblist file ...
+ libraryString := Smalltalk libraryFileNameOfClass:self.
+ libraryString isNil ifTrue:[^ nil].
+ ]
].
moduleString isEmpty ifTrue:[
- moduleString := 'stx'.
+ moduleString := 'stx'.
].
directoryString isEmpty ifTrue:[
- directoryString := libraryString.
+ directoryString := libraryString.
].
^ IdentityDictionary
- with:(#module->moduleString)
- with:(#directory->directoryString)
- with:(#library->libraryString)
+ with:(#module->moduleString)
+ with:(#directory->directoryString)
+ with:(#library->libraryString)
"
Object packageSourceCodeInfo
@@ -4862,5 +4863,5 @@
!Class class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/Class.st,v 1.457 2004-03-04 20:01:41 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/Class.st,v 1.458 2004-03-05 17:51:21 cg Exp $'
! !