Smalltalk.st
changeset 15783 647ea33569b6
parent 15781 3185deb3a8d2
child 15872 605d272f5e1c
child 18105 3a3a3e0ac47f
--- a/Smalltalk.st	Mon Oct 14 21:59:53 2013 +0200
+++ b/Smalltalk.st	Tue Oct 15 10:46:40 2013 +0200
@@ -23,9 +23,8 @@
 		PackagePath BinaryDirName ResourceDirName SourceDirName
 		BitmapDirName PackageDirName FileInDirName ChangeFileName
 		ImageStartTime ImageRestartTime DemoMode SaveEmergencyImage
-		SpecialObjectArray CallbackSignal KnownPackages
-		ClassesFailedToInitialize HasNoConsole IgnoreHalt
-		PackageToPathMapping'
+		SpecialObjectArray CallbackSignal ClassesFailedToInitialize
+		HasNoConsole IgnoreHalt PackageToPathMapping'
 	poolDictionaries:''
 	category:'System-Support'
 !
@@ -2109,12 +2108,6 @@
 
 !Smalltalk class methodsFor:'private-system management-packages'!
 
-knownPackages
-    <resource: #obsolete>
-    self obsoleteMethodWarning.
-    ^ KnownPackages ? #()
-!
-
 loadExtensionsForPackage:aPackageId
     | extensionsLoaded |
 
@@ -4986,77 +4979,71 @@
     |s2 l abbrevFileName info clsName cls abbrev package cat numClassInstVars words w|
 
     anAbbrevFileStream isFileStream ifTrue:[
-	abbrevFileName := anAbbrevFileStream pathName.
-	info := 'declared from: ', abbrevFileName.
-    ].
-
-    KnownPackages isNil ifTrue:[
-	KnownPackages := Set new.
+        abbrevFileName := anAbbrevFileStream pathName.
+        info := 'declared from: ', abbrevFileName.
     ].
 
     "/ yes, create any required nameSpace, without asking user.
     Class createNameSpaceQuerySignal answer:true do:[
 
-	[anAbbrevFileStream atEnd] whileFalse:[
-	    l := anAbbrevFileStream nextLine withoutSeparators.
-	    "Skip empty lines and comments"
-	    (l notEmpty and:[l first ~= $#]) ifTrue:[
-		"/ must do it manually, caring for quoted strings.
+        [anAbbrevFileStream atEnd] whileFalse:[
+            l := anAbbrevFileStream nextLine withoutSeparators.
+            "Skip empty lines and comments"
+            (l notEmpty and:[l first ~= $#]) ifTrue:[
+                "/ must do it manually, caring for quoted strings.
 "/                words := line asCollectionOfWords.
 
-		words := OrderedCollection new.
-		s2 := l readStream.
-		[s2 atEnd] whileFalse:[
-		    s2 skipSeparators.
-		    s2 peek == $' ifTrue:[
-			s2 next.
-			w := s2 upTo:$'.
-			s2 skipSeparators.
-		    ] ifFalse:[
-			w := s2 upToSeparator
-		    ].
-		    words add:w
-		].
-		words size < 3 ifTrue:[
-		    'Smalltalk [warning]: bad abbrev entry' errorPrint.
-		    anAbbrevFileStream isFileStream ifTrue:[
-			' (in ''' errorPrint.
-			anAbbrevFileStream pathName errorPrint.
-			''')' errorPrint
-		    ].
-		    ': ' errorPrint. l errorPrintCR
-		] ifFalse:[
-		    clsName := (words at:1) asSymbol.
-		    abbrev := (words at:2).
-		    package := (words at:3) asSymbol.
-		    cat := words at:4 ifAbsent:nil.
-		    numClassInstVars := words at:5 ifAbsent:'0'.
-		    numClassInstVars := Integer readFrom:numClassInstVars onError:[0].
-
-"/                KnownPackages add:package.
-
-		    (cat size == 0) ifTrue:[
-			cat := 'autoloaded'
-		    ].
-
-		    "/ on the fly, update the abbreviations
-		    self setFilename:abbrev forClass:clsName package:package.
-
-		    "/ '  autoloaded: ' print. clsName print. ' in ' print. cat printCR.
-
-		    cls := self
-			installAutoloadedClassNamed:clsName
-			category:cat
-			package:package
-			revision:nil
-			numClassInstVars:numClassInstVars.
+                words := OrderedCollection new.
+                s2 := l readStream.
+                [s2 atEnd] whileFalse:[
+                    s2 skipSeparators.
+                    s2 peek == $' ifTrue:[
+                        s2 next.
+                        w := s2 upTo:$'.
+                        s2 skipSeparators.
+                    ] ifFalse:[
+                        w := s2 upToSeparator
+                    ].
+                    words add:w
+                ].
+                words size < 3 ifTrue:[
+                    'Smalltalk [warning]: bad abbrev entry' errorPrint.
+                    anAbbrevFileStream isFileStream ifTrue:[
+                        ' (in ''' errorPrint.
+                        anAbbrevFileStream pathName errorPrint.
+                        ''')' errorPrint
+                    ].
+                    ': ' errorPrint. l errorPrintCR
+                ] ifFalse:[
+                    clsName := (words at:1) asSymbol.
+                    abbrev := (words at:2).
+                    package := (words at:3) asSymbol.
+                    cat := words at:4 ifAbsent:nil.
+                    numClassInstVars := words at:5 ifAbsent:'0'.
+                    numClassInstVars := Integer readFrom:numClassInstVars onError:[0].
+
+                    (cat size == 0) ifTrue:[
+                        cat := 'autoloaded'
+                    ].
+
+                    "/ on the fly, update the abbreviations
+                    self setFilename:abbrev forClass:clsName package:package.
+
+                    "/ '  autoloaded: ' print. clsName print. ' in ' print. cat printCR.
+
+                    cls := self
+                        installAutoloadedClassNamed:clsName
+                        category:cat
+                        package:package
+                        revision:nil
+                        numClassInstVars:numClassInstVars.
 
 "/                    info notNil ifTrue:[
 "/                        cls setComment:info.
 "/                    ].
-		]
-	    ]
-	]
+                ]
+            ]
+        ]
     ]
 !
 
@@ -5163,14 +5150,16 @@
 recursiveInstallAutoloadedClassesFrom:aDirectory rememberIn:dirsConsulted maxLevels:maxLevels noAutoload:noAutoloadIn packageTop:packageTopPath
     "read all abbrev.stc files from and under aDirectory
      and install autoloaded classes.
-     If a file called NOAUTOLOAD is found, no classes there and below are installed as autoloaded
-     (however, the directories are searched for packages)
+     If a file called NOAUTOLOAD is found, no classes there are installed as autoloaded,
+     but classes in subdirectories are installed, if the subdirectory contains a file
+     named AUTOLOAD.
+     If a file called NOSUBAUTOLOAD is found, no classes there and below are installed as autoloaded.
      If a file called NOPACKAGES is found, no further searching is done in that directory or below."
 
     self
-	recursiveInstallAutoloadedClassesFrom:aDirectory rememberIn:dirsConsulted
-	maxLevels:maxLevels noAutoload:noAutoloadIn packageTop:packageTopPath
-	showSplashInLevels:0.
+        recursiveInstallAutoloadedClassesFrom:aDirectory rememberIn:dirsConsulted
+        maxLevels:maxLevels noAutoload:noAutoloadIn packageTop:packageTopPath
+        showSplashInLevels:0.
 
     "
      Smalltalk installAutoloadedClasses
@@ -5184,24 +5173,20 @@
 showSplashInLevels:showSplashInLevels
     "read all abbrev.stc files from and under aDirectory
      and install autoloaded classes.
-     If a file called NOAUTOLOAD is found, no classes there and below are installed as autoloaded
-     (however, the directories are searched for packages)
+     If a file called NOAUTOLOAD is found, no classes there are installed as autoloaded,
+     but classes in subdirectories are installed, if the subdirectory contains a file
+     named AUTOLOAD.
+     If a file called NOSUBAUTOLOAD is found, no classes there and below are installed as autoloaded.
      If a file called NOPACKAGES is found, no further searching is done in that directory or below."
 
-    |dir noAutoloadHere dirName pkgName directoryContents haveAbbrevDotSTC|
-
-    maxLevels == 0 ifTrue:[
-"/        'Smalltalk [warning]: max directory nesting reached.' infoPrintCR.
-        ^ self
-    ].
+    |dir noAutoloadHere dirName directoryContents haveAbbrevDotSTC|
 
     dir := aDirectory asFilename.
-    dirName := dir pathName.
+    dirName := dir physicalPathName.            "take care of symbolic links"
 
     (dirsConsulted includes:dirName) ifTrue:[
         ^ self
     ].
-    dirsConsulted add:dirName.
 
     (dir / 'NOPACKAGES') exists ifTrue:[
         ^ self.
@@ -5210,6 +5195,12 @@
         ^ self.
     ].
 
+    maxLevels == 0 ifTrue:[
+        Transcript showCR:('Autoload: max directory nesting reached in %1' bindWith:dir pathName).        
+        ^ self
+    ].
+
+    dirsConsulted add:dirName.
     noAutoloadHere := noAutoloadIn.
     noAutoloadHere ifFalse:[
         (dir / 'NOAUTOLOAD') exists ifTrue:[
@@ -5221,16 +5212,6 @@
         ].
     ].
 
-    ((dir / 'loadAll') exists or:[(dir / 'abbrev.stc') exists]) ifTrue:[
-        packageTopPath notNil ifTrue:[
-            KnownPackages isNil ifTrue:[
-                KnownPackages := Set new.
-            ].
-            pkgName := dirName copyFrom:(packageTopPath asFilename pathName) size + 1 + 1.
-            KnownPackages add:pkgName
-        ].
-    ].
-
     showSplashInLevels >= 0 ifTrue:[
         self showSplashMessage:('Smalltalk [info]: installing autoloaded classes found under "%1"...'
                                 bindWith:(dirName contractAtBeginningTo:35)).
@@ -5293,7 +5274,13 @@
         ] ifFalse:[
             (noAutoloadHere not and:[haveAbbrevDotSTC not]) ifTrue:[
                 f suffix = 'st' ifTrue:[
-                    self installAutoloadedClassFromSourceFile:f
+                    [    
+                        self installAutoloadedClassFromSourceFile:f.
+                        f directory baseName = 'libbasic' ifTrue:[self halt].
+                    ] on:FileStream openErrorSignal do:[:ex| 
+                        "ignore this file, but write a warning"
+                        Transcript showCR:('Autoload: cannot install %1. (%2)' bindWith:f pathName with:ex description).        
+                    ].
                 ]            
             ].
         ]
@@ -7974,11 +7961,11 @@
 !Smalltalk class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.1038 2013-10-14 19:55:48 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.1039 2013-10-15 08:46:40 stefan Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.1038 2013-10-14 19:55:48 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.1039 2013-10-15 08:46:40 stefan Exp $'
 !
 
 version_SVN