SqueakVMPathAnswersResources preference

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

SqueakVMPathAnswersResources preference

Eliot Miranda-2
 
Hi All,

    I just added code to the Cog branch for the Mac VM so that whether primVmPath/primitiveVMPath answers the directory containing the VM.app or answers the Resources directory within the .app is controlled by the SqueakVMPathAnswersResources preference in the Info.plist file.  primVmPath is used to determine where to derive the sources file from.  By default primVmPath answers the directory containing the VM.app and therefore the sources file is at the same level, e.g. /Applications/Squeak.app & /Applications/SqueakV41.sources.  But some installations (e.g. Newspeak and the EToys all-in-one) may find it more convenient to put the sources in VM.app/Contents/Resources.  This means one file to install, not 2, etc.  I think it useful that this behavior be in the standard VM.  Esteban, if you agree, perhaps you could integrate into the trunk platforms/Mac OS?
--
best,
Eliot

Reply | Threaded
Open this post in threaded view
|

Re: SqueakVMPathAnswersResources preference

Bert Freudenberg


On 31.07.2011, at 19:18, Eliot Miranda wrote:

> Hi All,
>
>     I just added code to the Cog branch for the Mac VM so that whether primVmPath/primitiveVMPath answers the directory containing the VM.app or answers the Resources directory within the .app is controlled by the SqueakVMPathAnswersResources preference in the Info.plist file.  primVmPath is used to determine where to derive the sources file from.

Among other places.

>  By default primVmPath answers the directory containing the VM.app and therefore the sources file is at the same level, e.g. /Applications/Squeak.app & /Applications/SqueakV41.sources.  But some installations (e.g. Newspeak and the EToys all-in-one) may find it more convenient to put the sources in VM.app/Contents/Resources.  

That's what Etoys does, of course.

> This means one file to install, not 2, etc.  I think it useful that this behavior be in the standard VM.  Esteban, if you agree, perhaps you could integrate into the trunk platforms/Mac OS?

Not opposed to the change, but it's unnecessary for all-in-ones like Etoys.  The Squeak logic to open the sources file looks in the image directory anyway, which is the Resources folder.

- Bert -


Reply | Threaded
Open this post in threaded view
|

Re: SqueakVMPathAnswersResources preference

Eliot Miranda-2
 
Hi Bert,

On Sun, Jul 31, 2011 at 10:52 AM, Bert Freudenberg <[hidden email]> wrote:


On 31.07.2011, at 19:18, Eliot Miranda wrote:

> Hi All,
>
>     I just added code to the Cog branch for the Mac VM so that whether primVmPath/primitiveVMPath answers the directory containing the VM.app or answers the Resources directory within the .app is controlled by the SqueakVMPathAnswersResources preference in the Info.plist file.  primVmPath is used to determine where to derive the sources file from.

Among other places.

>  By default primVmPath answers the directory containing the VM.app and therefore the sources file is at the same level, e.g. /Applications/Squeak.app & /Applications/SqueakV41.sources.  But some installations (e.g. Newspeak and the EToys all-in-one) may find it more convenient to put the sources in VM.app/Contents/Resources.

That's what Etoys does, of course.

> This means one file to install, not 2, etc.  I think it useful that this behavior be in the standard VM.  Esteban, if you agree, perhaps you could integrate into the trunk platforms/Mac OS?

Not opposed to the change, but it's unnecessary for all-in-ones like Etoys.  The Squeak logic to open the sources file looks in the image directory anyway, which is the Resources folder.

I didn't find this code when I looked yesterday.  Can you spell this out for me?
 

- Bert -





--
best,
Eliot

Reply | Threaded
Open this post in threaded view
|

Re: SqueakVMPathAnswersResources preference

Bert Freudenberg
 

On 31.07.2011, at 20:55, Eliot Miranda wrote:

Hi Bert,

On Sun, Jul 31, 2011 at 10:52 AM, Bert Freudenberg <[hidden email]> wrote:


On 31.07.2011, at 19:18, Eliot Miranda wrote:

> Hi All,
>
>     I just added code to the Cog branch for the Mac VM so that whether primVmPath/primitiveVMPath answers the directory containing the VM.app or answers the Resources directory within the .app is controlled by the SqueakVMPathAnswersResources preference in the Info.plist file.  primVmPath is used to determine where to derive the sources file from.

Among other places.

>  By default primVmPath answers the directory containing the VM.app and therefore the sources file is at the same level, e.g. /Applications/Squeak.app & /Applications/SqueakV41.sources.  But some installations (e.g. Newspeak and the EToys all-in-one) may find it more convenient to put the sources in VM.app/Contents/Resources.

That's what Etoys does, of course.

> This means one file to install, not 2, etc.  I think it useful that this behavior be in the standard VM.  Esteban, if you agree, perhaps you could integrate into the trunk platforms/Mac OS?

Not opposed to the change, but it's unnecessary for all-in-ones like Etoys.  The Squeak logic to open the sources file looks in the image directory anyway, which is the Resources folder.

I didn't find this code when I looked yesterday.  Can you spell this out for me?

FileDirectory class>>openSources:forImage: {system start up}
tpr 2/17/2004 19:59 

openSources: fullSourcesName forImage: imageName 
"We first do a check to see if a compressed version ofthe sources file is present.
Open the .sources file read-only after searching in:
a) the directory where the VM lives
b) the directory where the image came from
c) the DefaultDirectory (which is likely the same as b unless the SecurityManager has changed it).
"

| sources fd sourcesName |
(fullSourcesName endsWith: 'sources') ifTrue:
["Look first for a sources file in compressed format."
sources _ self openSources: (fullSourcesName allButLast: 7) , 'stc'
forImage: imageName.
sources ifNotNil: [^ CompressedSourceStream on: sources]].

sourcesName _ FileDirectory localNameFor: fullSourcesName.
"look for the sources file or an alias to it in the VM's directory"
fd _ FileDirectory on: SmalltalkImage current vmPath.
(fd fileExists: sourcesName)
ifTrue: [sources _ fd readOnlyFileNamed: sourcesName].
sources ifNotNil: [^ sources].
"look for the sources file or an alias to it in the image directory"
fd _ FileDirectory on: (FileDirectory dirPathFor: imageName).
(fd fileExists: sourcesName)
ifTrue: [sources _ fd readOnlyFileNamed: sourcesName].
sources ifNotNil: [^ sources].
"look for the sources in the current directory"
fd _ DefaultDirectory.
(fd fileExists: sourcesName)
ifTrue: [sources _ fd readOnlyFileNamed: sourcesName].
"sources may still be nil here"
^sources


- Bert -


Reply | Threaded
Open this post in threaded view
|

Re: SqueakVMPathAnswersResources preference

EstebanLM
In reply to this post by Eliot Miranda-2

Hi,
Sorry for the delay... I've been running this days.
I think it can be useful to incorporate, and I will do it as soon as I find time, but not this month because I will be traveling...

cheers,
Esteban

El 31/07/2011, a las 2:18p.m., Eliot Miranda escribió:

> Hi All,
>
>     I just added code to the Cog branch for the Mac VM so that whether primVmPath/primitiveVMPath answers the directory containing the VM.app or answers the Resources directory within the .app is controlled by the SqueakVMPathAnswersResources preference in the Info.plist file.  primVmPath is used to determine where to derive the sources file from.  By default primVmPath answers the directory containing the VM.app and therefore the sources file is at the same level, e.g. /Applications/Squeak.app & /Applications/SqueakV41.sources.  But some installations (e.g. Newspeak and the EToys all-in-one) may find it more convenient to put the sources in VM.app/Contents/Resources.  This means one file to install, not 2, etc.  I think it useful that this behavior be in the standard VM.  Esteban, if you agree, perhaps you could integrate into the trunk platforms/Mac OS?
> --
> best,
> Eliot
>

Reply | Threaded
Open this post in threaded view
|

Re: SqueakVMPathAnswersResources preference

Eliot Miranda-2
In reply to this post by Bert Freudenberg
 
Hi Bert,

On Mon, Aug 1, 2011 at 5:12 AM, Bert Freudenberg <[hidden email]> wrote:
 

On 31.07.2011, at 20:55, Eliot Miranda wrote:

Hi Bert,

On Sun, Jul 31, 2011 at 10:52 AM, Bert Freudenberg <[hidden email]> wrote:


On 31.07.2011, at 19:18, Eliot Miranda wrote:

> Hi All,
>
>     I just added code to the Cog branch for the Mac VM so that whether primVmPath/primitiveVMPath answers the directory containing the VM.app or answers the Resources directory within the .app is controlled by the SqueakVMPathAnswersResources preference in the Info.plist file.  primVmPath is used to determine where to derive the sources file from.

Among other places.

>  By default primVmPath answers the directory containing the VM.app and therefore the sources file is at the same level, e.g. /Applications/Squeak.app & /Applications/SqueakV41.sources.  But some installations (e.g. Newspeak and the EToys all-in-one) may find it more convenient to put the sources in VM.app/Contents/Resources.

That's what Etoys does, of course.

> This means one file to install, not 2, etc.  I think it useful that this behavior be in the standard VM.  Esteban, if you agree, perhaps you could integrate into the trunk platforms/Mac OS?

Not opposed to the change, but it's unnecessary for all-in-ones like Etoys.  The Squeak logic to open the sources file looks in the image directory anyway, which is the Resources folder.

I didn't find this code when I looked yesterday.  Can you spell this out for me?

FileDirectory class>>openSources:forImage: {system start up}
tpr 2/17/2004 19:59 

openSources: fullSourcesName forImage: imageName 
"We first do a check to see if a compressed version ofthe sources file is present.
Open the .sources file read-only after searching in:
a) the directory where the VM lives
b) the directory where the image came from
c) the DefaultDirectory (which is likely the same as b unless the SecurityManager has changed it).
"

| sources fd sourcesName |
(fullSourcesName endsWith: 'sources') ifTrue:
["Look first for a sources file in compressed format."
sources _ self openSources: (fullSourcesName allButLast: 7) , 'stc'
forImage: imageName.
sources ifNotNil: [^ CompressedSourceStream on: sources]].

sourcesName _ FileDirectory localNameFor: fullSourcesName.
"look for the sources file or an alias to it in the VM's directory"
fd _ FileDirectory on: SmalltalkImage current vmPath.
(fd fileExists: sourcesName)
ifTrue: [sources _ fd readOnlyFileNamed: sourcesName].
sources ifNotNil: [^ sources].
"look for the sources file or an alias to it in the image directory"
fd _ FileDirectory on: (FileDirectory dirPathFor: imageName).
(fd fileExists: sourcesName)
ifTrue: [sources _ fd readOnlyFileNamed: sourcesName].
sources ifNotNil: [^ sources].
"look for the sources in the current directory"
fd _ DefaultDirectory.
(fd fileExists: sourcesName)
ifTrue: [sources _ fd readOnlyFileNamed: sourcesName].
"sources may still be nil here"
^sources

yes, I saw that.  But the above implies that the only way the sources are going to be found in the Resources directory is if primVmPath answers the Resources directory, right?  And at least in the Cog sources that wasn't the case until I made modifications.  Does the etoys VM have some modifications to primVmPath or does it patch the method or...?



- Bert -






--
best,
Eliot

Reply | Threaded
Open this post in threaded view
|

Re: SqueakVMPathAnswersResources preference

Bert Freudenberg
 

On 01.08.2011, at 21:34, Eliot Miranda wrote:

Hi Bert,

On Mon, Aug 1, 2011 at 5:12 AM, Bert Freudenberg <[hidden email]> wrote:
 

On 31.07.2011, at 20:55, Eliot Miranda wrote:

Hi Bert,

On Sun, Jul 31, 2011 at 10:52 AM, Bert Freudenberg <[hidden email]> wrote:


On 31.07.2011, at 19:18, Eliot Miranda wrote:

> Hi All,
>
>     I just added code to the Cog branch for the Mac VM so that whether primVmPath/primitiveVMPath answers the directory containing the VM.app or answers the Resources directory within the .app is controlled by the SqueakVMPathAnswersResources preference in the Info.plist file.  primVmPath is used to determine where to derive the sources file from.

Among other places.

>  By default primVmPath answers the directory containing the VM.app and therefore the sources file is at the same level, e.g. /Applications/Squeak.app & /Applications/SqueakV41.sources.  But some installations (e.g. Newspeak and the EToys all-in-one) may find it more convenient to put the sources in VM.app/Contents/Resources.

That's what Etoys does, of course.

> This means one file to install, not 2, etc.  I think it useful that this behavior be in the standard VM.  Esteban, if you agree, perhaps you could integrate into the trunk platforms/Mac OS?

Not opposed to the change, but it's unnecessary for all-in-ones like Etoys.  The Squeak logic to open the sources file looks in the image directory anyway, which is the Resources folder.

I didn't find this code when I looked yesterday.  Can you spell this out for me?

FileDirectory class>>openSources:forImage: {system start up}
tpr 2/17/2004 19:59 

openSources: fullSourcesName forImage: imageName 
"We first do a check to see if a compressed version ofthe sources file is present.
Open the .sources file read-only after searching in:
a) the directory where the VM lives
b) the directory where the image came from
c) the DefaultDirectory (which is likely the same as b unless the SecurityManager has changed it).
"

| sources fd sourcesName |
(fullSourcesName endsWith: 'sources') ifTrue:
["Look first for a sources file in compressed format."
sources _ self openSources: (fullSourcesName allButLast: 7) , 'stc'
forImage: imageName.
sources ifNotNil: [^ CompressedSourceStream on: sources]].

sourcesName _ FileDirectory localNameFor: fullSourcesName.
"look for the sources file or an alias to it in the VM's directory"
fd _ FileDirectory on: SmalltalkImage current vmPath.
(fd fileExists: sourcesName)
ifTrue: [sources _ fd readOnlyFileNamed: sourcesName].
sources ifNotNil: [^ sources].
"look for the sources file or an alias to it in the image directory"
fd _ FileDirectory on: (FileDirectory dirPathFor: imageName).
(fd fileExists: sourcesName)
ifTrue: [sources _ fd readOnlyFileNamed: sourcesName].
sources ifNotNil: [^ sources].
"look for the sources in the current directory"
fd _ DefaultDirectory.
(fd fileExists: sourcesName)
ifTrue: [sources _ fd readOnlyFileNamed: sourcesName].
"sources may still be nil here"
^sources

yes, I saw that.  But the above implies that the only way the sources are going to be found in the Resources directory is if primVmPath answers the Resources directory, right?

No.

 And at least in the Cog sources that wasn't the case until I made modifications.  Does the etoys VM have some modifications to primVmPath or does it patch the method or...?

As I wrote above "The Squeak logic to open the sources file looks in the image directory anyway, which is the Resources folder" because the Etoys image is in the Resources folder. Just like any other all-in-one I know.

- Bert -


Reply | Threaded
Open this post in threaded view
|

Re: SqueakVMPathAnswersResources preference

Eliot Miranda-2
 


On Mon, Aug 1, 2011 at 12:39 PM, Bert Freudenberg <[hidden email]> wrote:
 

On 01.08.2011, at 21:34, Eliot Miranda wrote:

Hi Bert,

On Mon, Aug 1, 2011 at 5:12 AM, Bert Freudenberg <[hidden email]> wrote:
 

On 31.07.2011, at 20:55, Eliot Miranda wrote:

Hi Bert,

On Sun, Jul 31, 2011 at 10:52 AM, Bert Freudenberg <[hidden email]> wrote:


On 31.07.2011, at 19:18, Eliot Miranda wrote:

> Hi All,
>
>     I just added code to the Cog branch for the Mac VM so that whether primVmPath/primitiveVMPath answers the directory containing the VM.app or answers the Resources directory within the .app is controlled by the SqueakVMPathAnswersResources preference in the Info.plist file.  primVmPath is used to determine where to derive the sources file from.

Among other places.

>  By default primVmPath answers the directory containing the VM.app and therefore the sources file is at the same level, e.g. /Applications/Squeak.app & /Applications/SqueakV41.sources.  But some installations (e.g. Newspeak and the EToys all-in-one) may find it more convenient to put the sources in VM.app/Contents/Resources.

That's what Etoys does, of course.

> This means one file to install, not 2, etc.  I think it useful that this behavior be in the standard VM.  Esteban, if you agree, perhaps you could integrate into the trunk platforms/Mac OS?

Not opposed to the change, but it's unnecessary for all-in-ones like Etoys.  The Squeak logic to open the sources file looks in the image directory anyway, which is the Resources folder.

I didn't find this code when I looked yesterday.  Can you spell this out for me?

FileDirectory class>>openSources:forImage: {system start up}
tpr 2/17/2004 19:59 

openSources: fullSourcesName forImage: imageName 
"We first do a check to see if a compressed version ofthe sources file is present.
Open the .sources file read-only after searching in:
a) the directory where the VM lives
b) the directory where the image came from
c) the DefaultDirectory (which is likely the same as b unless the SecurityManager has changed it).
"

| sources fd sourcesName |
(fullSourcesName endsWith: 'sources') ifTrue:
["Look first for a sources file in compressed format."
sources _ self openSources: (fullSourcesName allButLast: 7) , 'stc'
forImage: imageName.
sources ifNotNil: [^ CompressedSourceStream on: sources]].

sourcesName _ FileDirectory localNameFor: fullSourcesName.
"look for the sources file or an alias to it in the VM's directory"
fd _ FileDirectory on: SmalltalkImage current vmPath.
(fd fileExists: sourcesName)
ifTrue: [sources _ fd readOnlyFileNamed: sourcesName].
sources ifNotNil: [^ sources].
"look for the sources file or an alias to it in the image directory"
fd _ FileDirectory on: (FileDirectory dirPathFor: imageName).
(fd fileExists: sourcesName)
ifTrue: [sources _ fd readOnlyFileNamed: sourcesName].
sources ifNotNil: [^ sources].
"look for the sources in the current directory"
fd _ DefaultDirectory.
(fd fileExists: sourcesName)
ifTrue: [sources _ fd readOnlyFileNamed: sourcesName].
"sources may still be nil here"
^sources

yes, I saw that.  But the above implies that the only way the sources are going to be found in the Resources directory is if primVmPath answers the Resources directory, right?

No.

 And at least in the Cog sources that wasn't the case until I made modifications.  Does the etoys VM have some modifications to primVmPath or does it patch the method or...?

As I wrote above "The Squeak logic to open the sources file looks in the image directory anyway, which is the Resources folder" because the Etoys image is in the Resources folder. Just like any other all-in-one I know.

Ah, got you.  So the Info.plist names the image in the Resources directory and everything follows from there.  Thanks.
 

- Bert -






--
best,
Eliot