[Pkg] The Trunk: System-ar.343.mcz

commits at source.squeak.org commits at source.squeak.org
Tue Jun 22 03:38:27 UTC 2010


Andreas Raab uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-ar.343.mcz

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

Name: System-ar.343
Author: ar
Time: 21 June 2010, 8:36:36.846 pm
UUID: 178a99de-0c0e-7c42-bf93-a594eacce7aa
Ancestors: System-ar.342

Fixes an ancient issue when launching Squeak with a script as argument. The code the converted the script name to a file url was just utterly and horribly broken and could not possibly work. With the fix, one can now again start Squeak with arguments of the form:

	squeak mysqueak.image file.st
	squeak mysqueak.image scripts/file.st
	squeak mysqueak.image ../../svn/scripts/file.st

(and of course any kind of URL)

=============== Diff against System-ar.342 ===============

Item was changed:
  ----- Method: ProjectLauncher>>startUpAfterLogin (in category 'running') -----
  startUpAfterLogin
  	| scriptName loader isUrl |
  	self setupFlaps.
  	Preferences readDocumentAtStartup ifTrue: [
  		HTTPClient isRunningInBrowser ifTrue:[
  			self setupFromParameters.
  			scriptName := self parameterAt: 'src'.
  			CodeLoader defaultBaseURL: (self parameterAt: 'Base').
  		] ifFalse:[
  			scriptName := (Smalltalk documentPath) ifNil:[''].
  			scriptName := scriptName convertFromSystemString.
  			scriptName isEmpty ifFalse:[
  				"figure out if script name is a URL by itself"
  				isUrl := (scriptName asLowercase beginsWith:'http://') or:[
  						(scriptName asLowercase beginsWith:'file://') or:[
  						(scriptName asLowercase beginsWith:'ftp://')]].
+ 				isUrl ifFalse:[
+ 					"Allow for ../dir/scriptName arguments"
+ 					scriptName := (FileDirectory default uri 
+ 						resolveRelativeURI: scriptName) asString]].
- 				isUrl ifFalse:[scriptName := 'file:',scriptName]].
  		]. ]
  	ifFalse: [ scriptName := '' ].
  
  	scriptName isEmptyOrNil
  		ifTrue:[^Preferences eToyFriendly ifTrue: [self currentWorld addGlobalFlaps]].
  	loader := CodeLoader new.
  	loader loadSourceFiles: (Array with: scriptName).
  	(scriptName asLowercase endsWith: '.pr') 
  		ifTrue:[self installProjectFrom: loader]
  		ifFalse:[loader installSourceFiles].
  !



More information about the Packages mailing list