class: Smalltalk
authorClaus Gittinger <cg@exept.de>
Mon, 27 May 2013 15:23:58 +0200
changeset 15284 4cb1f1712ea2
parent 15283 e844c3fbfb3c
child 15285 7c7d4ed8296d
class: Smalltalk added: #reinitializePackagePath changed: #flushPathCaches #restart
Smalltalk.st
--- a/Smalltalk.st	Mon May 27 15:22:06 2013 +0200
+++ b/Smalltalk.st	Mon May 27 15:23:58 2013 +0200
@@ -3794,15 +3794,15 @@
      #earlySystemInstallation is sent for ST80 compatibility
 
      #earlyRestart is send first, nothing has been setup yet.
-		   (should be used to flush all device dependent entries)
+                   (should be used to flush all device dependent entries)
 
      #restarted is send right after.
-		   (should be used to recreate external resources (fds, bitmaps etc)
+                   (should be used to recreate external resources (fds, bitmaps etc)
 
      #returnFromSnapshot is sent last
-		   (should be used to restart processes, reOpen Streams which cannot
-		    be automatically be reopened (i.e. Sockets, Pipes) and so on.
-		   (Notice that positionable fileStreams are already reopened and repositioned)
+                   (should be used to restart processes, reOpen Streams which cannot
+                    be automatically be reopened (i.e. Sockets, Pipes) and so on.
+                   (Notice that positionable fileStreams are already reopened and repositioned)
      "
 
     |deb insp transcript idx|
@@ -3826,12 +3826,12 @@
 
     idx := CommandLineArguments indexOf:'-q'.
     idx == 0 ifTrue:[
-	idx := CommandLineArguments indexOf:'--silent'.
+        idx := CommandLineArguments indexOf:'--silent'.
     ].
     idx ~~ 0 ifTrue:[
-	Object infoPrinting:false.
-	ObjectMemory infoPrinting:false.
-	CommandLineArguments removeAtIndex:idx.
+        Object infoPrinting:false.
+        ObjectMemory infoPrinting:false.
+        CommandLineArguments removeAtIndex:idx.
     ].
 
     "/
@@ -3846,6 +3846,7 @@
     "/ flush cached path directories (may have changed in the meanwhile)
 
     self flushPathCaches.
+    self reinitializePackagePath.
 
     "/
     "/ reinit the default streams: Stdin, Stdout and Stderr
@@ -3866,7 +3867,7 @@
     insp := Inspector.
     deb := Debugger.
     deb notNil ifTrue:[
-	deb reinitialize
+        deb reinitialize
     ].
     Inspector := MiniInspector.
     Debugger := MiniDebugger.
@@ -3879,7 +3880,7 @@
     "/ ObjectFileLoader; therefore, must reload before doing any notifications.
 
     ObjectFileLoader notNil ifTrue:[
-	ObjectFileLoader reloadAllRememberedObjectFiles.
+        ObjectFileLoader reloadAllRememberedObjectFiles.
     ].
 
     "/
@@ -3888,9 +3889,9 @@
     "/ a display during early startup.
 
     Screen notNil ifTrue:[
-	Screen allScreens do:[:aDisplay |
-	    aDisplay invalidateConnection
-	].
+        Screen allScreens do:[:aDisplay |
+            aDisplay invalidateConnection
+        ].
     ].
 
     ObjectMemory changed:#earlySystemInstallation.
@@ -3906,7 +3907,7 @@
     "/ (mostly view/GC/color & font stuff)
 
     ObjectMemory
-	changed:#earlyRestart; changed:#restarted.
+        changed:#earlyRestart; changed:#restarted.
 
     "/
     "/ start catching SIGINT and SIGQUIT
@@ -3920,80 +3921,80 @@
 
     idx := CommandLineArguments indexOf:'--faststart'.
     idx == 0 ifTrue:[
-	idx := CommandLineArguments indexOf:'--fastStart'.
+        idx := CommandLineArguments indexOf:'--fastStart'.
     ].
     idx ~~ 0 ifTrue:[
-	CommandLineArguments removeAtIndex:idx.
+        CommandLineArguments removeAtIndex:idx.
     ] ifFalse:[
-	CallbackSignal := QuerySignal new.
-	[
-	    Class withoutUpdatingChangesDo:[
-		(self fileIn:(self commandName , '_r.rc')) ifFalse:[
-		    "no _r.rc file where executable is; try default smalltalk_r.rc"
-		    self fileIn:'smalltalk_r.rc'
-		].
-	    ]
-	] on:CallbackSignal do:[:ex|
-	    "/ now, display and view-stuff works;
-	    "/ back to the previous debugging interface
-
-	    Inspector := insp.
-	    Debugger := deb.
-
-	    "/ reinstall Transcript, if not changed during restart.
-	    "/ if there was no Transcript, go to stderr
-
-	    (transcript notNil and:[Transcript == Stderr]) ifTrue:[
-		Transcript := transcript.
-	    ].
-	    Initializing := false.
-	    ex proceed.
-	].
-	CallbackSignal := nil.
+        CallbackSignal := QuerySignal new.
+        [
+            Class withoutUpdatingChangesDo:[
+                (self fileIn:(self commandName , '_r.rc')) ifFalse:[
+                    "no _r.rc file where executable is; try default smalltalk_r.rc"
+                    self fileIn:'smalltalk_r.rc'
+                ].
+            ]
+        ] on:CallbackSignal do:[:ex|
+            "/ now, display and view-stuff works;
+            "/ back to the previous debugging interface
+
+            Inspector := insp.
+            Debugger := deb.
+
+            "/ reinstall Transcript, if not changed during restart.
+            "/ if there was no Transcript, go to stderr
+
+            (transcript notNil and:[Transcript == Stderr]) ifTrue:[
+                Transcript := transcript.
+            ].
+            Initializing := false.
+            ex proceed.
+        ].
+        CallbackSignal := nil.
     ].
 
     "/ reinitialization (restart) of Display is normally performed
     "/ in the restart script. If this has not been run for some reason,
     "/ do in now.
     Initializing ifTrue:[
-	Display notNil ifTrue:[
-	    [
-		Display reinitializeFor:Screen defaultDisplayName.
-	    ] on:Screen deviceOpenErrorSignal do:[
-		'Smalltalk [error]: Cannot restart connection to: ' errorPrint.
-		Screen defaultDisplayName errorPrintCR.
-		OperatingSystem exit:1.
-	    ].
-	].
-	"/ now, display and view-stuff works;
-	"/ back to the previous debugging interface
-
-	Inspector := insp.
-	Debugger := deb.
-
-	"/ reinstall Transcript, if not changed during restart.
-	"/ if there was no Transcript, go to stderr
-
-	(transcript notNil and:[Transcript == Stderr]) ifTrue:[
-	    Transcript := transcript.
-	].
-	Initializing := false.
+        Display notNil ifTrue:[
+            [
+                Display reinitializeFor:Screen defaultDisplayName.
+            ] on:Screen deviceOpenErrorSignal do:[
+                'Smalltalk [error]: Cannot restart connection to: ' errorPrint.
+                Screen defaultDisplayName errorPrintCR.
+                OperatingSystem exit:1.
+            ].
+        ].
+        "/ now, display and view-stuff works;
+        "/ back to the previous debugging interface
+
+        Inspector := insp.
+        Debugger := deb.
+
+        "/ reinstall Transcript, if not changed during restart.
+        "/ if there was no Transcript, go to stderr
+
+        (transcript notNil and:[Transcript == Stderr]) ifTrue:[
+            Transcript := transcript.
+        ].
+        Initializing := false.
     ].
     Screen notNil ifTrue:[
-	"clean up leftover screens (and views) that haven't been reopened.
-	 Operate on a copy, since brokenConnection removes us from AllScreens"
-	Screen allScreens copy do:[:eachDisplay |
-	    eachDisplay isOpen ifFalse:[
-		'Smalltalk [info]: cannot reopen secondary display: ' errorPrint.
-		eachDisplay errorPrintCR.
-		eachDisplay cleanupAfterDispatch; brokenConnection.
-	    ]
-	].
+        "clean up leftover screens (and views) that haven't been reopened.
+         Operate on a copy, since brokenConnection removes us from AllScreens"
+        Screen allScreens copy do:[:eachDisplay |
+            eachDisplay isOpen ifFalse:[
+                'Smalltalk [info]: cannot reopen secondary display: ' errorPrint.
+                eachDisplay errorPrintCR.
+                eachDisplay cleanupAfterDispatch; brokenConnection.
+            ]
+        ].
     ].
 
     deb := insp := transcript := nil.   "avoid dangling refs"
     (StartupClass perform:#keepSplashWindowOpen ifNotUnderstood:[false]) ifFalse:[
-	self hideSplashWindow.   "/ if there is one, it's now time to hide it
+        self hideSplashWindow.   "/ if there is one, it's now time to hide it
     ].
     self mainStartup:true
 
@@ -6387,13 +6388,6 @@
     RealSystemPath := ResourcePath := SourcePath :=
     BinaryPath := FileInPath := nil.
 
-    PackagePath notNil ifTrue:[
-        PackagePath := PackagePath select:[:p | p asFilename exists].
-    ].
-    PackagePath isEmptyOrNil ifTrue:[
-        PackagePath := OperatingSystem defaultPackagePath
-    ].
-
     "
      Smalltalk flushPathCaches
     "
@@ -7093,6 +7087,17 @@
     ].
 !
 
+reinitializePackagePath
+    "{ Pragma: +optSpace }"
+
+    PackagePath notNil ifTrue:[
+        PackagePath := PackagePath select:[:p | p asFilename exists].
+    ].
+    PackagePath isEmptyOrNil ifTrue:[
+        PackagePath := OperatingSystem defaultPackagePath
+    ].
+!
+
 relativePackagePathForPackage:aPackage
     |path|
 
@@ -7909,11 +7914,11 @@
 !Smalltalk class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.1029 2013-05-27 13:22:06 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.1030 2013-05-27 13:23:58 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.1029 2013-05-27 13:22:06 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.1030 2013-05-27 13:23:58 cg Exp $'
 !
 
 version_SVN