AbstractSourceCodeManager.st
changeset 4010 2d5dd6fc7885
parent 4008 0d40ebdb8760
child 4022 b596e506bbe9
child 4030 e0acccdb6a49
--- a/AbstractSourceCodeManager.st	Sat Apr 30 14:42:15 2016 +0200
+++ b/AbstractSourceCodeManager.st	Tue May 03 14:54:16 2016 +0200
@@ -1,5 +1,3 @@
-"{ Encoding: utf8 }"
-
 "
  COPYRIGHT (c) 1995 by Claus Gittinger
               All Rights Reserved
@@ -76,14 +74,23 @@
     "JV@2012-03-14: Changed to use .smalltalk/source-cache on UNIX machines"
     "CG: why only on unix machines???"
     
+    |dir|
+    
     CachingSources isNil ifTrue:[
         CachingSources := true.
     ].
-    OperatingSystem isUNIXlike ifTrue:[
-        CacheDirectoryName := '~/.smalltalk/sourceCache'.
-    ] ifFalse:[
-        CacheDirectoryName := (Filename defaultTempDirectory constructString:'stx_sourceCache').
-    ].
+
+    dir := Filename homeDirectory / '.smalltalk/sourceCache'. 
+    dir isWritableDirectory ifFalse:[
+        dir := Filename defaultTempDirectory / 'stx_sourceCache'.
+    ].  
+    CacheDirectoryName := dir pathName.
+
+"/    OperatingSystem isUNIXlike ifTrue:[
+"/        CacheDirectoryName := '~/.smalltalk/sourceCache'.
+"/    ] ifFalse:[
+"/        CacheDirectoryName := (Filename defaultTempDirectory constructString:'stx_sourceCache').
+"/    ].
     
     "
      self initCacheDirPath     
@@ -2534,12 +2541,12 @@
 
     |versionString|
 
-    versionString := aString copyWithout: $§.
+    versionString := aString copyWithout: $§.
     ^ self ensureKeywordExpansionWith: $$ inVersionMethod:versionString.
 
     "
      self ensureDollarsInVersionMethod:'foo ^ ''hello'' ' 
-     self ensureDollarsInVersionMethod:'foo ^ ''§hello§'' ' 
+     self ensureDollarsInVersionMethod:'foo ^ ''§hello§'' ' 
      self ensureDollarsInVersionMethod:'foo ^ ''   hello   '' '    
      self ensureDollarsInVersionMethod:'foo ^ ''$','Header: /cvs/stx/stx/libbasic3/AbstractSourceCodeManager.st,v 1.228 2009/10/20 09:55:58 fm Exp $'' '      
     -- errors:
@@ -2624,17 +2631,17 @@
         ,aCharacter asString ,(aString copyFrom:indexOfLastQuote)
 
     "
-     self ensureKeywordExpansionWith: $§ inVersionMethod: 'foo ^ ''hello'' '  
-     self ensureKeywordExpansionWith: $§ inVersionMethod: 'foo ^ ''   hello   '' '
-     self ensureKeywordExpansionWith: $§ inVersionMethod: 'foo ^ ''§Header: /cvs/stx/stx/libbasic3/AbstractSourceCodeManager.st,v 1.218 2009/10/07 12:12:30 fm Exp §'' '    
+     self ensureKeywordExpansionWith: $§ inVersionMethod: 'foo ^ ''hello'' '  
+     self ensureKeywordExpansionWith: $§ inVersionMethod: 'foo ^ ''   hello   '' '
+     self ensureKeywordExpansionWith: $§ inVersionMethod: 'foo ^ ''§Header: /cvs/stx/stx/libbasic3/AbstractSourceCodeManager.st,v 1.218 2009/10/07 12:12:30 fm Exp §'' '    
 
      self ensureKeywordExpansionWith: $$ inVersionMethod: 'foo ^ ''hello'' '  
      self ensureKeywordExpansionWith: $$ inVersionMethod: 'foo ^ ''   hello   '' '
      self ensureKeywordExpansionWith: $$ inVersionMethod: 'foo ^ ''$','Header: /cvs/stx/stx/libbasic3/AbstractSourceCodeManager.st,v 1.228 2009/10/20 09:55:58 fm Exp $'' '    
 
     -- errors:
-     self ensureKeywordExpansionWith: $§ inVersionMethod: 'foo ^ ''§Head'' '  
-     self ensureKeywordExpansionWith: $§ inVersionMethod: 'foo ^ ''Header§'' '   
+     self ensureKeywordExpansionWith: $§ inVersionMethod: 'foo ^ ''§Head'' '  
+     self ensureKeywordExpansionWith: $§ inVersionMethod: 'foo ^ ''Header§'' '   
     "
 !
 
@@ -2647,23 +2654,23 @@
 
 ensureNoDollarsInVersionMethod:aString
     "given the source code of another manager's version method, ensure that it does NOT
-     contain dollars and add $§ instead, to avoid that CVS expands keywords in it"
+     contain dollars and add $§ instead, to avoid that CVS expands keywords in it"
 
     |versionString|
 
     versionString := aString copyWithout: $$.
-    ^ self ensureKeywordExpansionWith: $§ inVersionMethod:versionString.
+    ^ self ensureKeywordExpansionWith: $§ inVersionMethod:versionString.
 
     "
         self ensureNoDollarsInVersionMethod:'foo ^ ''$','Header: /cvs/stx/stx/libbasic3/AbstractSourceCodeManager.st,v 1.228 2009/10/20 09:55:58 fm Exp $'' '           
         self ensureNoDollarsInVersionMethod:'foo ^ ''$','Head'' '                
         self ensureNoDollarsInVersionMethod:'foo ^ ''Header$'' '             
-        self ensureNoDollarsInVersionMethod:'foo ^ ''§Header§'' '    
+        self ensureNoDollarsInVersionMethod:'foo ^ ''§Header§'' '    
 
       -- errors:
 
-        self ensureNoDollarsInVersionMethod:'foo ^ ''§Header'' '   
-        self ensureNoDollarsInVersionMethod:'foo ^ ''Header§'' '             
+        self ensureNoDollarsInVersionMethod:'foo ^ ''§Header'' '   
+        self ensureNoDollarsInVersionMethod:'foo ^ ''Header§'' '             
 
     "
 !