[squeak-dev] The Trunk: System-dtl.1064.mcz

patrick.rein at hpi.uni-potsdam.de patrick.rein at hpi.uni-potsdam.de
Tue May 14 10:27:25 UTC 2019


Hi everyone,

this breaks loading scripts on some platforms as Url>>#newFromRelativeText: is not a replacement for URI>>#resolveRelativeURI:. The old one can deal with absolute URLs, the new one just concatenates the two Urls. Now the question is where to fix this. The relative in the name is misleading so maybe we need another method.

Bests,
Patrick

>David T. Lewis uploaded a new version of System to project The Trunk:
>http://source.squeak.org/trunk/System-dtl.1064.mcz
>
>==================== Summary ====================
>
>Name: System-dtl.1064
>Author: dtl
>Time: 13 May 2019, 7:06:32.400119 pm
>UUID: 66a39f74-a4b5-41d0-8e02-c0d01632080d
>Ancestors: System-pre.1063
>
>Use Url rather than deprecated URI in ProjectLauncher>>startUpAfterLogin.
>This prevents command line startup scripts from failing due to a deprecation warning.
>Also fix a comment typo.
>
>=============== Diff against System-pre.1063 ===============
>
>Item was changed:
>  ----- Method: CodeLoader>>allButShebangLine: (in category 'private') -----
>  allButShebangLine: contentsString
>+ 	"If contentsString begins with '#!!' then assume that it contains a Unix
>- 	"If tontentsString begins with '#!!' then assume that it contains a Unix
>  	shebang line should be skipped prior to evaluating the contents."
>  	
>  	(contentsString beginsWith: '#!!')
>  		ifTrue: [contentsString lineIndicesDo: [:line :end :endOfLine |
>  			^ contentsString allButFirst: endOfLine ]]
>  		ifFalse: [^ contentsString]
>  
>  	" CodeLoader new allButShebangLine:
>  '#!!/usr/llocal/bin/squeak --
>  Transcript cr; show: ''Hello world!!''
>  ' "!
>
>Item was changed:
>  ----- Method: ProjectLauncher>>startUpAfterLogin (in category 'running') -----
>  startUpAfterLogin
>  	| scriptName loader isUrl |
>  	self setupFlaps.
>  	Preferences readDocumentAtStartup
>  		ifTrue: [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: [| encodedPath pathTokens |
>  							"Allow for ../dir/scriptName arguments"
>  							pathTokens := scriptName splitBy: FileDirectory slash.
>  							pathTokens := pathTokens
>  										collect: [:s | s encodeForHTTP].
>  							encodedPath := pathTokens
>  										reduce: [:acc :each | acc , FileDirectory slash , each].
>+ 							scriptName := (FileDirectory default asUrl newFromRelativeText: encodedPath) asString]]]
>- 							scriptName := (FileDirectory default uri resolveRelativeURI: encodedPath) asString]]]
>  		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 Squeak-dev mailing list