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

commits at source.squeak.org commits at source.squeak.org
Mon May 13 23:06:35 UTC 2019


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