[squeak-dev] The Trunk: System-cmm.608.mcz

commits at source.squeak.org commits at source.squeak.org
Fri Oct 25 20:39:25 UTC 2013


Chris Muller uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-cmm.608.mcz

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

Name: System-cmm.608
Author: cmm
Time: 25 October 2013, 3:38:27.908 pm
UUID: c3198c63-1008-493a-8e6b-b63886ab70cf
Ancestors: System-ul.607

Convenience method for passing .st scripts as arguments to image.  In the .st script, use Smalltalk do: [ :arg1 :arg2 :etc | ] to start servers, #doAndQuit: [ :args | ... ] for batch jobs, and #do:snapshot:andQuit: for jobs that "build" new images (e.g., for testing and/or deployment).  Arguments from the command-line are passed as arguments to the block.

In all cases, Notifications and Errors are logged to stdout and stderr, respectively.

=============== Diff against System-ul.607 ===============

Item was added:
+ ----- Method: SmalltalkImage>>do: (in category 'command line') -----
+ do: aBlock
+ 	[ [ aBlock valueWithAllPossibleArguments: self arguments ]
+ 		on: ProgressInitiationException
+ 		do:
+ 			[ : pie | "Don't want to log this notification."
+ 			pie defaultAction ] ]
+ 		on: Notification , Warning
+ 		do:
+ 			[ : noti | StandardFileStream stdout
+ 				 nextPutAll: DateAndTime now asString ;
+ 				 space ;
+ 				 nextPutAll: noti description ;
+ 				 cr.
+ 			noti resume ]
+ 		on: SyntaxErrorNotification
+ 		do:
+ 			[ : err | StandardFileStream stdout
+ 				 nextPutAll: err errorCode ;
+ 				 cr.
+ 			self haltOrQuit ]
+ 		on: Error
+ 		do:
+ 			[ : err | err printVerboseOn: StandardFileStream stderr.
+ 			self haltOrQuit.
+ 			err isResumable ifTrue: [ err resume ] ]!

Item was added:
+ ----- Method: SmalltalkImage>>do:snapshotAs:andQuit: (in category 'command line') -----
+ do: aBlock snapshotAs: imageName andQuit: shouldQuit 
+ 	self do: aBlock.
+ 	imageName
+ 		ifNil:
+ 			[ shouldQuit ifTrue:
+ 				[ self
+ 					snapshot: false
+ 					andQuit: shouldQuit ] ]
+ 		ifNotNil:
+ 			[ | correctName |
+ 			correctName := (imageName endsWith: '.image')
+ 				ifTrue: [ imageName ]
+ 				ifFalse: [ imageName , '.image' ].
+ 			(FileDirectory default fullNameFor: correctName) = self imageName
+ 				ifTrue:
+ 					[ self
+ 						snapshot: true
+ 						andQuit: shouldQuit ]
+ 				ifFalse:
+ 					[ self saveAs: imageName.
+ 					"Avoid instant-quit when relaunching by resaving."
+ 					shouldQuit ifTrue:
+ 						[ self
+ 							snapshot: true
+ 							andQuit: shouldQuit ] ] ]!

Item was added:
+ ----- Method: SmalltalkImage>>doAndQuit: (in category 'command line') -----
+ doAndQuit: aBlock 
+ 	self
+ 		do: aBlock
+ 		snapshotAs: nil
+ 		andQuit: true!

Item was added:
+ ----- Method: SmalltalkImage>>haltOrQuit (in category 'command line') -----
+ haltOrQuit
+ 	Smalltalk isHeadless
+ 		ifTrue:
+ 			[ self
+ 				snapshot: false
+ 				andQuit: true ]
+ 		ifFalse: [ self halt ]!



More information about the Squeak-dev mailing list