AbstractSourceCodeManager.st
branchjv
changeset 4061 8d6d7c54f8a6
parent 4053 7817fc8db06e
parent 4056 8b51ad64f9d4
child 4074 533d1c715e83
--- a/AbstractSourceCodeManager.st	Mon Jun 06 12:32:59 2016 +0100
+++ b/AbstractSourceCodeManager.st	Tue Jun 14 08:59:01 2016 +0100
@@ -17,8 +17,8 @@
 
 Object subclass:#AbstractSourceCodeManager
 	instanceVariableNames:''
-	classVariableNames:'DefaultManager CachingSources CacheDirectoryName UseWorkTree
-		WorkTreeDirectoryName ManagerPerModule Verbose
+	classVariableNames:'CacheDirectoryName CachingSources DefaultManager ManagerPerModule
+		UseWorkTree Verbose WorkTreeDirectoryName
 		ManagerForPackageCache'
 	poolDictionaries:''
 	category:'System-SourceCodeManagement'
@@ -1592,10 +1592,16 @@
     "/ however, it only contains partial information (module:directory:libName).
     "/ (but is available even without a source)
     "/
-    packageInfo := cls packageSourceCodeInfo.
-    packageInfo notNil ifTrue:[
-        packageInfo keysAndValuesDo:[:key :value |
-            newInfo at:key put:value
+    cls name = cls package ifTrue:[
+        "/ very special - the top-modules FolderInfo
+        newInfo at:#module put:cls package.
+        newInfo at:#directory put:''.
+    ] ifFalse:[        
+        packageInfo := cls packageSourceCodeInfo.
+        packageInfo notNil ifTrue:[
+            packageInfo keysAndValuesDo:[:key :value |
+                newInfo at:key put:value
+            ]
         ]
     ].
 
@@ -1676,20 +1682,17 @@
 
     "/ guess on the container
     ((newInfo includesKey:#directory) and:[newInfo includesKey:#module]) ifTrue:[
-        |pathInRepository|
-
+        |moduleDirectory pathInRepository|
+
+        (newInfo at:#directory) isEmpty ifTrue:[
+            moduleDirectory := (newInfo at:#module).
+        ] ifFalse:[
+            moduleDirectory := (newInfo at:#module) , '/' , (newInfo at:#directory).
+        ].        
         container isNil ifTrue:[
-            container := (newInfo at:#module)
-                         , '/'
-                         , (newInfo at:#directory)
-                         , '/'
-                         , classFileNameBase , ',v'.
+            container := moduleDirectory , '/' , classFileNameBase , ',v'.
         ].
-        pathInRepository := (newInfo at:#module)
-                     , '/'
-                     , (newInfo at:#directory)
-                     , '/'
-                     , classFileNameBase.
+        pathInRepository := moduleDirectory , '/' , classFileNameBase.
         newInfo at:#pathInRepository put:pathInRepository.
     ].