UnixOperatingSystem.st
changeset 16646 eb3524f545f4
parent 16645 1888b2ecfd66
child 16653 d7cee2a6cdc3
--- a/UnixOperatingSystem.st	Sun Jun 29 10:46:36 2014 +0200
+++ b/UnixOperatingSystem.st	Sun Jun 29 10:51:27 2014 +0200
@@ -8766,9 +8766,11 @@
     "add additional directories to the systemPath
      (but only, if the major version is the same)"
 
-    |sysPath majorVersionNr releaseFile s v|
+    |sysPath majorVersionNr minorVersionNr releaseFile vsnDirName s v|
 
     majorVersionNr := Smalltalk majorVersionNr.
+    minorVersionNr := Smalltalk minorVersionNr.
+    vsnDirName := '%1.%2' bindWith:majorVersionNr with:minorVersionNr.
 
     sysPath := super defaultSystemPath.
     #(
@@ -8785,25 +8787,32 @@
         '/opt/smalltalk'
         '/opt/smalltalk-x'
     ) do:[:dirName |
-        |dir|
+        |dir vsnDir|
 
         dir := dirName asFilename.
         (dir isDirectory) ifTrue:[
             "/ try to guess a gnu-smalltalk; skip it
             (dir construct:'initialize.st') exists ifFalse:[
-                releaseFile := dir construct:'RELEASE'.
-                releaseFile exists ifTrue:[
-                    s := releaseFile readStreamOrNil.
-                    s notNil ifTrue:[
-                        v := Integer readFrom:s onError:-1.
-                        s close.
-                        v == majorVersionNr ifTrue:[
-                            sysPath add:dirName
+                vsnDir := dir / vsnDirName.
+                vsnDir exists ifTrue:[
+                    "/ new style: look for a major.minor directory there
+                    sysPath add:vsnDir.
+                ] ifFalse:[
+                    "/ old style: look for a RELEASE file there and check if it matches
+                    releaseFile := dir construct:'RELEASE'.
+                    releaseFile exists ifTrue:[
+                        s := releaseFile readStreamOrNil.
+                        s notNil ifTrue:[
+                            v := Integer readFrom:s onError:-1.
+                            s close.
+                            v == majorVersionNr ifTrue:[
+                                sysPath add:dirName
+                            ] ifFalse:[
+                                ('UnixOperatingSystem [info]: ignore files in ' , dir pathName , ' (RELEASE mismatch)') infoPrintCR.
+                            ]
                         ] ifFalse:[
-                            ('UnixOperatingSystem [info]: ignore files in ' , dir pathName , ' (RELEASE mismatch)') infoPrintCR.
+                            ('UnixOperatingSystem [info]: ignore files in ' , dir pathName , ' (RELEASE missing)') infoPrintCR.
                         ]
-                    ] ifFalse:[
-                        ('UnixOperatingSystem [info]: ignore files in ' , dir pathName , ' (RELEASE missing)') infoPrintCR.
                     ]
                 ]
             ]
@@ -13273,11 +13282,11 @@
 !UnixOperatingSystem class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/UnixOperatingSystem.st,v 1.370 2014-06-29 08:46:36 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/UnixOperatingSystem.st,v 1.371 2014-06-29 08:51:27 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/UnixOperatingSystem.st,v 1.370 2014-06-29 08:46:36 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/UnixOperatingSystem.st,v 1.371 2014-06-29 08:51:27 cg Exp $'
 ! !