[squeak-dev] The Trunk: System-dtl.1062.mcz
John Pfersich
smalltalker2 at mac.com
Mon May 6 03:01:08 UTC 2019
Is that #! or #!!
/————————————————————/
For encrypted mail use jgpfersich at protonmail.com
Get a free account at ProtonMail.com
Web: www.objectnets.net and www.objectnets.org
> On May 5, 2019, at 19:55, commits at source.squeak.org wrote:
>
> David T. Lewis uploaded a new version of System to project The Trunk:
> http://source.squeak.org/trunk/System-dtl.1062.mcz
>
> ==================== Summary ====================
>
> Name: System-dtl.1062
> Author: dtl
> Time: 5 May 2019, 10:54:56.642077 pm
> UUID: c527ef41-51fb-4e49-b00a-90a9a09a935d
> Ancestors: System-cmm.1061
>
> If CodeLoader is loading a script that begins with a Unix shebang line, then skip over line one of the script. This accomodates the case of an executable Unix shell script that starts a Squeak image, then feeds itself to Squeak as a start script. For example, an executable script file might contain this:
>
> #!/usr/local/bin/squeak --
> Transcript show: 'Hello, world'; cr.
>
> =============== Diff against System-cmm.1061 ===============
>
> Item was added:
> + ----- Method: CodeLoader>>allButShebangLine: (in category 'private') -----
> + allButShebangLine: contentsString
> + "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: CodeLoader>>installSourceFile: (in category 'installing') -----
> installSourceFile: aStream
> "Install the previously loaded source file"
> | contents trusted |
> aStream ifNil:[^self error:'No content to install'].
> trusted := SecurityManager default positionToSecureContentsOf: aStream.
> trusted ifFalse:[(SecurityManager default enterRestrictedMode)
> ifFalse:[ aStream close.
> ^ self error:'Insecure content encountered']].
> + contents := self allButShebangLine: aStream upToEnd unzipped asString.
> - contents := aStream upToEnd unzipped asString.
> (aStream respondsTo: #close) ifTrue:[aStream close].
> ^contents readStream fileIn!
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20190505/7b2be2ac/attachment.html>
More information about the Squeak-dev
mailing list
|