AbstractOperatingSystem.st
changeset 14574 aa666a65f111
parent 14565 ddebb49ea73c
child 14604 cc6062243652
equal deleted inserted replaced
14573:f89b1f406974 14574:aa666a65f111
  4252     "/ the executable's directory
  4252     "/ the executable's directory
  4253     "/    and the executables parent directory (if it is an installed version)
  4253     "/    and the executables parent directory (if it is an installed version)
  4254     "/
  4254     "/
  4255     appPath := self pathOfSTXExecutable.
  4255     appPath := self pathOfSTXExecutable.
  4256     appPath notNil ifTrue:[
  4256     appPath notNil ifTrue:[
  4257 	appDir := appPath asFilename directory.
  4257         appDir := appPath asFilename directory.
  4258 	appPath := appDir pathName.
  4258         appPath := appDir pathName.
  4259 	(sysPath includes:appPath) ifFalse:[
  4259         (sysPath includes:appPath) ifFalse:[
  4260 	    sysPath add:appPath.
  4260             sysPath add:appPath.
  4261 	].
  4261         ].
  4262 	appDir baseName = 'bin' ifTrue:[
  4262         appDir baseName = 'bin' ifTrue:[
  4263 	    appPath := appDir directory pathName.
  4263             appPath := appDir directory pathName.
  4264 	    (sysPath includes:appPath) ifFalse:[
  4264             (sysPath includes:appPath) ifFalse:[
  4265 		sysPath add:appPath.
  4265                 sysPath add:appPath.
  4266 	    ].
  4266             ].
  4267 	].
  4267         ].
  4268     ].
  4268     ].
  4269 
  4269 
  4270     "/
  4270     "/
  4271     "/ the users home (login) directory
  4271     "/ the users home (login) directory
  4272     "/
  4272     "/
  4273     homePath := self getHomeDirectory.
  4273     homePath := self getHomeDirectory.
  4274     homePath notNil ifTrue:[
  4274     homePath notNil ifTrue:[
  4275 	"/
  4275         "/
  4276 	"/ a users private smalltalk directory in its home (login) directory
  4276         "/ a users private smalltalk directory in its home (login) directory
  4277 	"/
  4277         "/
  4278 	OperatingSystem isUNIXlike ifTrue:[
  4278         OperatingSystem isUNIXlike ifTrue:[
  4279 	    priv := '.smalltalk'.
  4279             priv := '.smalltalk'.
  4280 	] ifFalse:[
  4280         ] ifFalse:[
  4281 	    priv := 'smalltalk'.
  4281             priv := 'smalltalk'.
  4282 	].
  4282         ].
  4283 	userPrivateSTXDir := homePath asFilename construct:priv.
  4283         userPrivateSTXDir := homePath asFilename construct:priv.
  4284 	(userPrivateSTXDir isDirectory) ifTrue:[
  4284         (userPrivateSTXDir isDirectory) ifTrue:[
  4285 	    userPrivateSTXDir := userPrivateSTXDir pathName.
  4285             userPrivateSTXDir := userPrivateSTXDir pathName.
  4286 	    (sysPath includes:userPrivateSTXDir) ifFalse:[
  4286             (sysPath includes:userPrivateSTXDir) ifFalse:[
  4287 		sysPath add:userPrivateSTXDir
  4287                 sysPath add:userPrivateSTXDir
  4288 	    ]
  4288             ]
  4289 	].
  4289         ].
  4290     ].
  4290     ].
  4291 
  4291 
  4292     "/
  4292     "/
  4293     "/ SMALLTALK_LIBDIR, STX_LIBDIR and STX_TOPDIR from the environment
  4293     "/ SMALLTALK_LIBDIR, STX_LIBDIR and STX_TOPDIR from the environment
  4294     "/
  4294     "/
  4295     #(
  4295     #(
  4296 	'SMALLTALK_LIBDIR'
  4296         'SMALLTALK_LIBDIR'
  4297 	'STX_LIBDIR'
  4297         'STX_LIBDIR'
  4298 	'STX_TOPDIR'
  4298         'STX_TOPDIR'
  4299      ) do:[:each |
  4299      ) do:[:each |
  4300 	p := OperatingSystem getEnvironment:each.
  4300         p := OperatingSystem decodePath:(OperatingSystem getEnvironment:each).
  4301 	p notNil ifTrue:[
  4301         p notNil ifTrue:[
  4302 	    p := p asFilename pathName.
  4302             p := p asFilename pathName.
  4303 	    (p asFilename isDirectory) ifTrue:[
  4303             (p asFilename isDirectory) ifTrue:[
  4304 		(sysPath includes:p) ifFalse:[
  4304                 (sysPath includes:p) ifFalse:[
  4305 		     sysPath add:p
  4305                      sysPath add:p
  4306 		]
  4306                 ]
  4307 	    ]
  4307             ]
  4308 	].
  4308         ].
  4309     ].
  4309     ].
  4310     ^ sysPath
  4310     ^ sysPath
  4311 
  4311 
  4312     "
  4312     "
  4313 	OperatingSystem defaultSystemPath
  4313         OperatingSystem defaultSystemPath
  4314     "
  4314     "
  4315 
  4315 
  4316     "Modified: / 24.12.1999 / 00:30:27 / cg"
  4316     "Modified: / 24.12.1999 / 00:30:27 / cg"
  4317 !
  4317 !
  4318 
  4318 
  7144 ! !
  7144 ! !
  7145 
  7145 
  7146 !AbstractOperatingSystem class methodsFor:'documentation'!
  7146 !AbstractOperatingSystem class methodsFor:'documentation'!
  7147 
  7147 
  7148 version
  7148 version
  7149     ^ '$Header: /cvs/stx/stx/libbasic/AbstractOperatingSystem.st,v 1.221 2012-12-13 13:18:43 stefan Exp $'
  7149     ^ '$Header: /cvs/stx/stx/libbasic/AbstractOperatingSystem.st,v 1.222 2012-12-13 13:52:25 stefan Exp $'
  7150 !
  7150 !
  7151 
  7151 
  7152 version_CVS
  7152 version_CVS
  7153     ^ '$Header: /cvs/stx/stx/libbasic/AbstractOperatingSystem.st,v 1.221 2012-12-13 13:18:43 stefan Exp $'
  7153     ^ '$Header: /cvs/stx/stx/libbasic/AbstractOperatingSystem.st,v 1.222 2012-12-13 13:52:25 stefan Exp $'
  7154 ! !
  7154 ! !
  7155 
  7155 
  7156 AbstractOperatingSystem initialize!
  7156 AbstractOperatingSystem initialize!