UnixOperatingSystem.st
changeset 16646 eb3524f545f4
parent 16645 1888b2ecfd66
child 16653 d7cee2a6cdc3
equal deleted inserted replaced
16645:1888b2ecfd66 16646:eb3524f545f4
  8764 
  8764 
  8765 defaultSystemPath
  8765 defaultSystemPath
  8766     "add additional directories to the systemPath
  8766     "add additional directories to the systemPath
  8767      (but only, if the major version is the same)"
  8767      (but only, if the major version is the same)"
  8768 
  8768 
  8769     |sysPath majorVersionNr releaseFile s v|
  8769     |sysPath majorVersionNr minorVersionNr releaseFile vsnDirName s v|
  8770 
  8770 
  8771     majorVersionNr := Smalltalk majorVersionNr.
  8771     majorVersionNr := Smalltalk majorVersionNr.
       
  8772     minorVersionNr := Smalltalk minorVersionNr.
       
  8773     vsnDirName := '%1.%2' bindWith:majorVersionNr with:minorVersionNr.
  8772 
  8774 
  8773     sysPath := super defaultSystemPath.
  8775     sysPath := super defaultSystemPath.
  8774     #(
  8776     #(
  8775         '/usr/local/lib/stx'
  8777         '/usr/local/lib/stx'
  8776         '/usr/local/lib/smalltalk'
  8778         '/usr/local/lib/smalltalk'
  8783         '/lib/smalltalk-x'
  8785         '/lib/smalltalk-x'
  8784         '/opt/stx'
  8786         '/opt/stx'
  8785         '/opt/smalltalk'
  8787         '/opt/smalltalk'
  8786         '/opt/smalltalk-x'
  8788         '/opt/smalltalk-x'
  8787     ) do:[:dirName |
  8789     ) do:[:dirName |
  8788         |dir|
  8790         |dir vsnDir|
  8789 
  8791 
  8790         dir := dirName asFilename.
  8792         dir := dirName asFilename.
  8791         (dir isDirectory) ifTrue:[
  8793         (dir isDirectory) ifTrue:[
  8792             "/ try to guess a gnu-smalltalk; skip it
  8794             "/ try to guess a gnu-smalltalk; skip it
  8793             (dir construct:'initialize.st') exists ifFalse:[
  8795             (dir construct:'initialize.st') exists ifFalse:[
  8794                 releaseFile := dir construct:'RELEASE'.
  8796                 vsnDir := dir / vsnDirName.
  8795                 releaseFile exists ifTrue:[
  8797                 vsnDir exists ifTrue:[
  8796                     s := releaseFile readStreamOrNil.
  8798                     "/ new style: look for a major.minor directory there
  8797                     s notNil ifTrue:[
  8799                     sysPath add:vsnDir.
  8798                         v := Integer readFrom:s onError:-1.
  8800                 ] ifFalse:[
  8799                         s close.
  8801                     "/ old style: look for a RELEASE file there and check if it matches
  8800                         v == majorVersionNr ifTrue:[
  8802                     releaseFile := dir construct:'RELEASE'.
  8801                             sysPath add:dirName
  8803                     releaseFile exists ifTrue:[
       
  8804                         s := releaseFile readStreamOrNil.
       
  8805                         s notNil ifTrue:[
       
  8806                             v := Integer readFrom:s onError:-1.
       
  8807                             s close.
       
  8808                             v == majorVersionNr ifTrue:[
       
  8809                                 sysPath add:dirName
       
  8810                             ] ifFalse:[
       
  8811                                 ('UnixOperatingSystem [info]: ignore files in ' , dir pathName , ' (RELEASE mismatch)') infoPrintCR.
       
  8812                             ]
  8802                         ] ifFalse:[
  8813                         ] ifFalse:[
  8803                             ('UnixOperatingSystem [info]: ignore files in ' , dir pathName , ' (RELEASE mismatch)') infoPrintCR.
  8814                             ('UnixOperatingSystem [info]: ignore files in ' , dir pathName , ' (RELEASE missing)') infoPrintCR.
  8804                         ]
  8815                         ]
  8805                     ] ifFalse:[
       
  8806                         ('UnixOperatingSystem [info]: ignore files in ' , dir pathName , ' (RELEASE missing)') infoPrintCR.
       
  8807                     ]
  8816                     ]
  8808                 ]
  8817                 ]
  8809             ]
  8818             ]
  8810         ]
  8819         ]
  8811     ].
  8820     ].
 13271 ! !
 13280 ! !
 13272 
 13281 
 13273 !UnixOperatingSystem class methodsFor:'documentation'!
 13282 !UnixOperatingSystem class methodsFor:'documentation'!
 13274 
 13283 
 13275 version
 13284 version
 13276     ^ '$Header: /cvs/stx/stx/libbasic/UnixOperatingSystem.st,v 1.370 2014-06-29 08:46:36 cg Exp $'
 13285     ^ '$Header: /cvs/stx/stx/libbasic/UnixOperatingSystem.st,v 1.371 2014-06-29 08:51:27 cg Exp $'
 13277 !
 13286 !
 13278 
 13287 
 13279 version_CVS
 13288 version_CVS
 13280     ^ '$Header: /cvs/stx/stx/libbasic/UnixOperatingSystem.st,v 1.370 2014-06-29 08:46:36 cg Exp $'
 13289     ^ '$Header: /cvs/stx/stx/libbasic/UnixOperatingSystem.st,v 1.371 2014-06-29 08:51:27 cg Exp $'
 13281 ! !
 13290 ! !
 13282 
 13291 
 13283 
 13292 
 13284 UnixOperatingSystem initialize!
 13293 UnixOperatingSystem initialize!
 13285 UnixOperatingSystem::FileDescriptorHandle initialize!
 13294 UnixOperatingSystem::FileDescriptorHandle initialize!