AbstractSourceCodeManager.st
changeset 4056 8b51ad64f9d4
parent 4046 1d63073ace00
child 4061 8d6d7c54f8a6
child 4068 1d49703e6826
--- a/AbstractSourceCodeManager.st	Thu Jun 09 19:34:31 2016 +0200
+++ b/AbstractSourceCodeManager.st	Thu Jun 09 19:34:40 2016 +0200
@@ -17,8 +17,8 @@
 
 Object subclass:#AbstractSourceCodeManager
 	instanceVariableNames:''
-	classVariableNames:'DefaultManager CachingSources CacheDirectoryName UseWorkTree
-		WorkTreeDirectoryName ManagerPerModule Verbose'
+	classVariableNames:'CacheDirectoryName CachingSources DefaultManager ManagerPerModule
+		UseWorkTree Verbose WorkTreeDirectoryName'
 	poolDictionaries:''
 	category:'System-SourceCodeManagement'
 !
@@ -1529,10 +1529,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
+            ]
         ]
     ].
 
@@ -1613,20 +1619,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.
     ].