diff -r 154d0c28b2cc -r b19dbde11fd3 AbstractOperatingSystem.st --- a/AbstractOperatingSystem.st Fri Mar 16 15:46:17 2018 +0100 +++ b/AbstractOperatingSystem.st Mon Mar 19 11:30:49 2018 +0100 @@ -1,5 +1,3 @@ -"{ Encoding: utf8 }" - " COPYRIGHT (c) 1988 by Claus Gittinger All Rights Reserved @@ -1139,6 +1137,7 @@ "Created: / 12.11.1998 / 14:39:20 / cg" ! ! + !AbstractOperatingSystem class methodsFor:'executing OS commands-public'! executeCommand:aCommandString @@ -5249,48 +5248,48 @@ "/ packagePath add:('.' "Filename currentDirectory pathName"). - "/ accept the fact that sometimes, we cannot figure out, where I im + "/ accept the fact that sometimes, we cannot figure out, where I am execPath := self pathOfSTXExecutable. execPath notNil ifTrue:[ - "/ - "/ the executable's directory: - "/ (/opt/stx/bin/stx -> /opt/stx/bin) - "/ - appDir := execPath asFilename directory. - dirName := appDir pathName. - (packagePath includes:dirName) ifFalse:[ - packagePath add:dirName. - ]. - - "/ - "/ the executable's parent directory: - "/ (/opt/stx/bin/stx -> /opt/stx) - "/ - appDir := appDir directory. - dirName := appDir pathName. - (packagePath includes:dirName) ifFalse:[ - packagePath add:dirName. - ]. + "/ + "/ the executable's directory: + "/ (/opt/stx/bin/stx -> /opt/stx/bin) + "/ + appDir := execPath asFilename directory. + dirName := appDir pathName. + (packagePath includes:dirName) ifFalse:[ + packagePath add:dirName. + ]. + + "/ + "/ the executable's parent directory: + "/ (/opt/stx/bin/stx -> /opt/stx) + "/ + appDir := appDir directory. + dirName := appDir pathName. + (packagePath includes:dirName) ifFalse:[ + packagePath add:dirName. + ]. ]. homeDirName := OperatingSystem getHomeDirectory. homeDirName notNil ifTrue:[ - "/ - "/ a users private smalltalk directory in its home (login) directory: - "/ $HOME/.smalltalk/packages or $HOME\smalltalk\packages - "/ - OperatingSystem isUNIXlike ifTrue:[ - priv := '.smalltalk'. - ] ifFalse:[ - priv := 'smalltalk'. - ]. - userPrivateSTXDir := homeDirName asFilename / priv. - (userPrivateSTXDir isDirectory) ifTrue:[ - dirName := userPrivateSTXDir pathName. - (packagePath includes:dirName) ifFalse:[ - packagePath add:dirName - ] - ]. + "/ + "/ a users private smalltalk directory in its home (login) directory: + "/ $HOME/.smalltalk/packages or $HOME\smalltalk\packages + "/ + OperatingSystem isUNIXlike ifTrue:[ + priv := '.smalltalk'. + ] ifFalse:[ + priv := 'smalltalk'. + ]. + userPrivateSTXDir := homeDirName asFilename / priv. + (userPrivateSTXDir isDirectory) ifTrue:[ + dirName := userPrivateSTXDir pathName. + (packagePath includes:dirName) ifFalse:[ + packagePath add:dirName + ] + ]. ]. "/ @@ -5299,62 +5298,62 @@ "/ topDirName := OperatingSystem getEnvironment:'STX_TOPDIR'. topDirName notNil ifTrue:[ - (packagePath includes:topDirName) ifFalse:[ - packagePath add:topDirName - ]. + (packagePath includes:topDirName) ifFalse:[ + packagePath add:topDirName + ]. ]. packagePath := packagePath - collect:[:each | - |p| - - (p := each asFilename / 'packages') exists ifTrue:[ - p pathName - ] ifFalse:[ - (p := each asFilename / 'Packages') exists ifTrue:[ - p pathName - ] ifFalse:[ - nil - ]. - ]. - ] - thenSelect:[:each | each notNil]. + collect:[:each | + |p| + + (p := each asFilename / 'packages') exists ifTrue:[ + p pathName + ] ifFalse:[ + (p := each asFilename / 'Packages') exists ifTrue:[ + p pathName + ] ifFalse:[ + nil + ]. + ]. + ] + thenSelect:[:each | each notNil]. " unconditionally prepend all directories from $STX_PACKAGEPATH " (dirName := OperatingSystem getEnvironment:'STX_PACKAGEPATH') notNil ifTrue:[ - dirName := dirName asCollectionOfSubstringsSeparatedBy:$:. - dirName reverseDo:[:eachDirectoryName| - (packagePath includes:eachDirectoryName) ifFalse:[ - packagePath addFirst:eachDirectoryName. - ]. - ]. + dirName := dirName asCollectionOfSubstringsSeparatedBy:$:. + dirName reverseDo:[:eachDirectoryName| + (packagePath includes:eachDirectoryName) ifFalse:[ + packagePath addFirst:eachDirectoryName. + ]. + ]. ]. false ifTrue:[ appDir notNil ifTrue:[ - "maybe the sources are kept in a central place..." - (appDir / 'source') isDirectory ifTrue:[ - packagePath add:(appDir / 'source') pathName. - ]. + "maybe the sources are kept in a central place..." + (appDir / 'source') isDirectory ifTrue:[ + packagePath add:(appDir / 'source') pathName. + ]. ]. ]. "maybe we are running in the build environment: XXX/stx /projects /smalltalk - or: XXX/exept /expecco /application + or: XXX/exept /expecco /application - if XXX/stx/libbasic exists, add XXX to the package path" false ifTrue:[ topDirName isNil ifTrue:[ - "appdir is now: projects" - appDir := appDir directory directory. - (appDir / 'stx' / 'libbasic') isDirectory ifTrue:[ - appDir pathName = homeDirName ifTrue:[ - "but take care, it may be directly in the home directory" - appDir := appDir / 'stx'. - ]. - packagePath add:appDir pathName. - ]. + "appdir is now: projects" + appDir := appDir directory directory. + (appDir / 'stx' / 'libbasic') isDirectory ifTrue:[ + appDir pathName = homeDirName ifTrue:[ + "but take care, it may be directly in the home directory" + appDir := appDir / 'stx'. + ]. + packagePath add:appDir pathName. + ]. ]. ]. ^ packagePath