[Pkg] The Trunk: System-ul.528.mcz

commits at source.squeak.org commits at source.squeak.org
Sun Oct 20 19:26:24 UTC 2013


David T. Lewis uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-ul.528.mcz

==================== Summary ====================

Name: System-ul.528
Author: ul
Time: 12 May 2013, 10:33:50.489 pm
UUID: d59743da-b5a5-4413-81f4-eb6dd7f7704d
Ancestors: System-fbs.527

Added support for defining the exit code when quitting.

=============== Diff against System-fbs.527 ===============

Item was added:
+ ----- Method: SmalltalkImage>>quitPrimitive: (in category 'snapshot and quit') -----
+ quitPrimitive: exitCode
+ 	"Primitive. Exit with exitCode to another operating system on the host machine, if one exists. All state changes in the object space since the last snapshot are lost. Ignore exitCode if it's not supported by the VM."
+ 
+ 	<primitive: 113>
+ 	self quitPrimitive!

Item was changed:
  ----- Method: SmalltalkImage>>snapshot:andQuit:embedded: (in category 'snapshot and quit') -----
  snapshot: save andQuit: quit embedded: embeddedFlag
- 	"Mark the changes file and close all files as part of #processShutdownList.
- 	If save is true, save the current state of this Smalltalk in the image file.
- 	If quit is true, then exit to the outer OS shell.
- 	The latter part of this method runs when resuming a previously saved image. This resume logic checks for a document file to process when starting up."
- 	| resuming msg |
- 	Object flushDependents.
- 	Object flushEvents.
  
+ 	^self	
+ 		snapshot: save
+ 		andQuit: quit
+ 		withExitCode: nil
+ 		embedded: embeddedFlag!
- 	(SourceFiles at: 2) ifNotNil:[
- 		msg := String streamContents: [ :s |
- 			s nextPutAll: '----';
- 			nextPutAll: (save ifTrue: [ quit ifTrue: [ 'QUIT' ] ifFalse: [ 'SNAPSHOT' ] ]
- 							ifFalse: [quit ifTrue: [ 'QUIT/NOSAVE' ] ifFalse: [ 'NOP' ]]);
- 			nextPutAll: '----';
- 			print: Date dateAndTimeNow; space;
- 			nextPutAll: (FileDirectory default localNameFor: self imageName);
- 			nextPutAll: ' priorSource: ';
- 			print: LastQuitLogPosition ].
- 		self assureStartupStampLogged.
- 		save ifTrue: [ LastQuitLogPosition := (SourceFiles at: 2) setToEnd; position ].
- 		self logChange: msg.
- 		Transcript cr; show: msg
- 	].
- 
- 	Smalltalk processShutDownList: quit.
- 	Cursor write show.
- 	save ifTrue: [resuming := embeddedFlag 
- 					ifTrue: [self snapshotEmbeddedPrimitive] 
- 					ifFalse: [self snapshotPrimitive].  "<-- PC frozen here on image file"
- 				resuming == false "guard against failure" ifTrue:
- 					["Time to reclaim segment files is immediately after a save"
- 					Smalltalk at: #ImageSegment
- 						ifPresent: [:theClass | theClass reclaimObsoleteSegmentFiles]]]
- 		ifFalse: [resuming := false].
- 	quit & (resuming == false) ifTrue: [self quitPrimitive].
- 	Cursor normal show.
- 	Smalltalk setGCParameters.
- 	resuming == true ifTrue: [Smalltalk clearExternalObjects].
- 	Smalltalk processStartUpList: resuming == true.
- 	resuming == true ifTrue:[
- 		self setPlatformPreferences.
- 		self recordStartupStamp].
- 	Project current wakeUpTopWindow.
- 	"Now it's time to raise an error"
- 	resuming == nil ifTrue: [self error:'Failed to write image file (disk full?)'].
- 	^ resuming!

Item was added:
+ ----- Method: SmalltalkImage>>snapshot:andQuit:withExitCode:embedded: (in category 'snapshot and quit') -----
+ snapshot: save andQuit: quit withExitCode: exitCode embedded: embeddedFlag
+ 	"Mark the changes file and close all files as part of #processShutdownList.
+ 	If save is true, save the current state of this Smalltalk in the image file.
+ 	If quit is true, then exit to the outer OS shell.
+ 	If exitCode is not nil, then use it as exit code.
+ 	The latter part of this method runs when resuming a previously saved image. This resume logic checks for a document file to process when starting up."
+ 
+ 	| resuming msg |
+ 	Object flushDependents.
+ 	Object flushEvents.
+ 
+ 	(SourceFiles at: 2) ifNotNil:[
+ 		msg := String streamContents: [ :s |
+ 			s nextPutAll: '----';
+ 			nextPutAll: (save ifTrue: [ quit ifTrue: [ 'QUIT' ] ifFalse: [ 'SNAPSHOT' ] ]
+ 							ifFalse: [quit ifTrue: [ 'QUIT/NOSAVE' ] ifFalse: [ 'NOP' ]]);
+ 			nextPutAll: '----';
+ 			print: Date dateAndTimeNow; space;
+ 			nextPutAll: (FileDirectory default localNameFor: self imageName);
+ 			nextPutAll: ' priorSource: ';
+ 			print: LastQuitLogPosition ].
+ 		self assureStartupStampLogged.
+ 		save ifTrue: [ LastQuitLogPosition := (SourceFiles at: 2) setToEnd; position ].
+ 		self logChange: msg.
+ 		Transcript cr; show: msg
+ 	].
+ 
+ 	Smalltalk processShutDownList: quit.
+ 	Cursor write show.
+ 	save ifTrue: [resuming := embeddedFlag 
+ 					ifTrue: [self snapshotEmbeddedPrimitive] 
+ 					ifFalse: [self snapshotPrimitive].  "<-- PC frozen here on image file"
+ 				resuming == false "guard against failure" ifTrue:
+ 					["Time to reclaim segment files is immediately after a save"
+ 					Smalltalk at: #ImageSegment
+ 						ifPresent: [:theClass | theClass reclaimObsoleteSegmentFiles]]]
+ 		ifFalse: [resuming := false].
+ 	quit & (resuming == false) ifTrue: [
+ 		exitCode
+ 			ifNil: [ self quitPrimitive ]
+ 			ifNotNil: [ self quitPrimitive: exitCode ] ].
+ 	Cursor normal show.
+ 	Smalltalk setGCParameters.
+ 	resuming == true ifTrue: [Smalltalk clearExternalObjects].
+ 	Smalltalk processStartUpList: resuming == true.
+ 	resuming == true ifTrue:[
+ 		self setPlatformPreferences.
+ 		self recordStartupStamp].
+ 	Project current wakeUpTopWindow.
+ 	"Now it's time to raise an error"
+ 	resuming == nil ifTrue: [self error:'Failed to write image file (disk full?)'].
+ 	^ resuming!

Item was added:
+ ----- Method: SmalltalkImage>>snapshot:andQuitWithExitCode: (in category 'snapshot and quit') -----
+ snapshot: save andQuitWithExitCode: exitCode
+ 
+ 	^self
+ 		snapshot: save
+ 		andQuit: true
+ 		withExitCode: exitCode
+ 		embedded: false!



More information about the Packages mailing list