Having a shared package-cache Re: MCDirectoryRepository defaultDirectoryName ignored?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Having a shared package-cache Re: MCDirectoryRepository defaultDirectoryName ignored?

Mariano Martinez Peck


On Sat, Oct 15, 2011 at 8:54 PM, Sean P. DeNigris <[hidden email]> wrote:

Mariano Martinez Peck wrote:
>
> it seems "ignored"

When I created the accessors and setting, the purpose was so that when you
add a directory repository via the MC Browser ("+Repository"->directory),
the UI would start in this directory. I wanted this because all my local
repos are in the same parent directory and it saved me having to navigate
there as I added every new repository. This is the only place where it is
used. We could:
* comment/rename the current functionality to reflect this
* or, update the other use cases you describe to use it

Hi guys. I would really LOVE to have a shared package-cache among images. I have (really) 1 gb of .mcz in different package-cache.
I am using new images all the time (hence package cache is empty). I would love to be able to reuse the same package-cache directory for all my images.
So...how can I change the place where the package-cache is created so that it uses another directory?

Thanks in advance,

Mariano

 

HTH,
Sean

--
View this message in context: http://forum.world.st/MCDirectoryRepository-defaultDirectoryName-ignored-tp3907508p3908028.html
Sent from the Pharo Smalltalk mailing list archive at Nabble.com.




--
Mariano
http://marianopeck.wordpress.com

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Having a shared package-cache Re: MCDirectoryRepository defaultDirectoryName ignored?

Sven Van Caekenberghe

On 21 Oct 2011, at 11:47, Mariano Martinez Peck wrote:

> Hi guys. I would really LOVE to have a shared package-cache among images. I have (really) 1 gb of .mcz in different package-cache.
> I am using new images all the time (hence package cache is empty). I would love to be able to reuse the same package-cache directory for all my images.
> So...how can I change the place where the package-cache is created so that it uses another directory?

Mine is 0.75 GB, but shared: I put all my images in the same directory.
Working with links is also an option, I think that is what Lukas' build scripts do.

Sven


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Having a shared package-cache Re: MCDirectoryRepository defaultDirectoryName ignored?

Lukas Renggli
You could add startup code that resets it to an absolute fixed location.

I would go with the links.

Lukas

On 21 October 2011 11:59, Sven Van Caekenberghe <[hidden email]> wrote:

>
> On 21 Oct 2011, at 11:47, Mariano Martinez Peck wrote:
>
>> Hi guys. I would really LOVE to have a shared package-cache among images. I have (really) 1 gb of .mcz in different package-cache.
>> I am using new images all the time (hence package cache is empty). I would love to be able to reuse the same package-cache directory for all my images.
>> So...how can I change the place where the package-cache is created so that it uses another directory?
>
> Mine is 0.75 GB, but shared: I put all my images in the same directory.
> Working with links is also an option, I think that is what Lukas' build scripts do.
>
> Sven
>
>
>



--
Lukas Renggli
www.lukas-renggli.ch

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Having a shared package-cache Re: MCDirectoryRepository defaultDirectoryName ignored?

Mariano Martinez Peck
Thanks guys. I was able to successfully change the directory of the package-cache.

On Fri, Oct 21, 2011 at 12:15 PM, Lukas Renggli <[hidden email]> wrote:
You could add startup code that resets it to an absolute fixed location.

I would go with the links.

Lukas

On 21 October 2011 11:59, Sven Van Caekenberghe <[hidden email]> wrote:
>
> On 21 Oct 2011, at 11:47, Mariano Martinez Peck wrote:
>
>> Hi guys. I would really LOVE to have a shared package-cache among images. I have (really) 1 gb of .mcz in different package-cache.
>> I am using new images all the time (hence package cache is empty). I would love to be able to reuse the same package-cache directory for all my images.
>> So...how can I change the place where the package-cache is created so that it uses another directory?
>
> Mine is 0.75 GB, but shared: I put all my images in the same directory.
> Working with links is also an option, I think that is what Lukas' build scripts do.
>
> Sven
>
>
>



--
Lukas Renggli
www.lukas-renggli.ch




--
Mariano
http://marianopeck.wordpress.com

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Having a shared package-cache Re: MCDirectoryRepository defaultDirectoryName ignored?

Stéphane Ducasse
how?

Stef

On Oct 21, 2011, at 11:26 PM, Mariano Martinez Peck wrote:

> Thanks guys. I was able to successfully change the directory of the package-cache.
>
> On Fri, Oct 21, 2011 at 12:15 PM, Lukas Renggli <[hidden email]> wrote:
> You could add startup code that resets it to an absolute fixed location.
>
> I would go with the links.
>
> Lukas
>
> On 21 October 2011 11:59, Sven Van Caekenberghe <[hidden email]> wrote:
> >
> > On 21 Oct 2011, at 11:47, Mariano Martinez Peck wrote:
> >
> >> Hi guys. I would really LOVE to have a shared package-cache among images. I have (really) 1 gb of .mcz in different package-cache.
> >> I am using new images all the time (hence package cache is empty). I would love to be able to reuse the same package-cache directory for all my images.
> >> So...how can I change the place where the package-cache is created so that it uses another directory?
> >
> > Mine is 0.75 GB, but shared: I put all my images in the same directory.
> > Working with links is also an option, I think that is what Lukas' build scripts do.
> >
> > Sven
> >
> >
> >
>
>
>
> --
> Lukas Renggli
> www.lukas-renggli.ch
>
>
>
>
> --
> Mariano
> http://marianopeck.wordpress.com
>


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Having a shared package-cache Re: MCDirectoryRepository defaultDirectoryName ignored?

Mariano Martinez Peck
I am not sure if it is the best solution, but it works, an that's all I need :)
 What I did is to implement two extension methods:

MCCachedRepository >> marianoDefaultWithDirectory: aDirectory
    self checkCacheDirectory.
    ^ default ifNil: [default := self new directory: aDirectory]

MCCachedRepository >> marianoReset
    default := nil.

And then in my build script I execute:

MCCacheRepository marianoReset.
MCCacheRepository marianoDefaultWithDirectory: self sharedPackageCacheDirectory.

>> sharedPackageCacheDirectory
(FileDirectory on: self sharedPackageCacheName)
        assureExistence;
        yourself

>> sharedPackageCacheName
    ^ '/Users/mariano/Pharo/localRepo/'


Cheers

On Sun, Oct 23, 2011 at 10:51 PM, Stéphane Ducasse <[hidden email]> wrote:
how?

Stef

On Oct 21, 2011, at 11:26 PM, Mariano Martinez Peck wrote:

> Thanks guys. I was able to successfully change the directory of the package-cache.
>
> On Fri, Oct 21, 2011 at 12:15 PM, Lukas Renggli <[hidden email]> wrote:
> You could add startup code that resets it to an absolute fixed location.
>
> I would go with the links.
>
> Lukas
>
> On 21 October 2011 11:59, Sven Van Caekenberghe <[hidden email]> wrote:
> >
> > On 21 Oct 2011, at 11:47, Mariano Martinez Peck wrote:
> >
> >> Hi guys. I would really LOVE to have a shared package-cache among images. I have (really) 1 gb of .mcz in different package-cache.
> >> I am using new images all the time (hence package cache is empty). I would love to be able to reuse the same package-cache directory for all my images.
> >> So...how can I change the place where the package-cache is created so that it uses another directory?
> >
> > Mine is 0.75 GB, but shared: I put all my images in the same directory.
> > Working with links is also an option, I think that is what Lukas' build scripts do.
> >
> > Sven
> >
> >
> >
>
>
>
> --
> Lukas Renggli
> www.lukas-renggli.ch
>
>
>
>
> --
> Mariano
> http://marianopeck.wordpress.com
>





--
Mariano
http://marianopeck.wordpress.com

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Having a shared package-cache Re: MCDirectoryRepository defaultDirectoryName ignored?

Mariano Martinez Peck


On Sun, Oct 23, 2011 at 11:13 PM, Mariano Martinez Peck <[hidden email]> wrote:
I am not sure if it is the best solution, but it works, an that's all I need :)
 What I did is to implement two extension methods:

MCCachedRepository >> marianoDefaultWithDirectory: aDirectory
    self checkCacheDirectory.
    ^ default ifNil: [default := self new directory: aDirectory]

MCCachedRepository >> marianoReset
    default := nil.


Maybe this is helpful for other guys as well? In such case, I can commit:

MCCachedRepository >> changeDefaultWithDirectory: aDirectory
    default := nil.
    ^ default ifNil: [default := self new directory: aDirectory]

What do you think?

Cheers

 
And then in my build script I execute:

MCCacheRepository marianoReset.
MCCacheRepository marianoDefaultWithDirectory: self sharedPackageCacheDirectory.

>> sharedPackageCacheDirectory
(FileDirectory on: self sharedPackageCacheName)
        assureExistence;
        yourself

>> sharedPackageCacheName
    ^ '/Users/mariano/Pharo/localRepo/'


Cheers


On Sun, Oct 23, 2011 at 10:51 PM, Stéphane Ducasse <[hidden email]> wrote:
how?

Stef

On Oct 21, 2011, at 11:26 PM, Mariano Martinez Peck wrote:

> Thanks guys. I was able to successfully change the directory of the package-cache.
>
> On Fri, Oct 21, 2011 at 12:15 PM, Lukas Renggli <[hidden email]> wrote:
> You could add startup code that resets it to an absolute fixed location.
>
> I would go with the links.
>
> Lukas
>
> On 21 October 2011 11:59, Sven Van Caekenberghe <[hidden email]> wrote:
> >
> > On 21 Oct 2011, at 11:47, Mariano Martinez Peck wrote:
> >
> >> Hi guys. I would really LOVE to have a shared package-cache among images. I have (really) 1 gb of .mcz in different package-cache.
> >> I am using new images all the time (hence package cache is empty). I would love to be able to reuse the same package-cache directory for all my images.
> >> So...how can I change the place where the package-cache is created so that it uses another directory?
> >
> > Mine is 0.75 GB, but shared: I put all my images in the same directory.
> > Working with links is also an option, I think that is what Lukas' build scripts do.
> >
> > Sven
> >
> >
> >
>
>
>
> --
> Lukas Renggli
> www.lukas-renggli.ch
>
>
>
>
> --
> Mariano
> http://marianopeck.wordpress.com
>





--
Mariano
http://marianopeck.wordpress.com




--
Mariano
http://marianopeck.wordpress.com

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Having a shared package-cache Re: MCDirectoryRepository defaultDirectoryName ignored?

Stéphane Ducasse
yes publish it somewhere.

On Oct 24, 2011, at 1:07 PM, Mariano Martinez Peck wrote:

>
>
> On Sun, Oct 23, 2011 at 11:13 PM, Mariano Martinez Peck <[hidden email]> wrote:
> I am not sure if it is the best solution, but it works, an that's all I need :)
>  What I did is to implement two extension methods:
>
> MCCachedRepository >> marianoDefaultWithDirectory: aDirectory
>     self checkCacheDirectory.
>     ^ default ifNil: [default := self new directory: aDirectory]
>
> MCCachedRepository >> marianoReset
>     default := nil.
>
>
> Maybe this is helpful for other guys as well? In such case, I can commit:
>
> MCCachedRepository >> changeDefaultWithDirectory: aDirectory
>     default := nil.
>     ^ default ifNil: [default := self new directory: aDirectory]
>
> What do you think?
>
> Cheers
>
>  
> And then in my build script I execute:
>
> MCCacheRepository marianoReset.
> MCCacheRepository marianoDefaultWithDirectory: self sharedPackageCacheDirectory.
>
> >> sharedPackageCacheDirectory
> (FileDirectory on: self sharedPackageCacheName)
>         assureExistence;
>         yourself
>
> >> sharedPackageCacheName
>     ^ '/Users/mariano/Pharo/localRepo/'
>
>
> Cheers
>
>
> On Sun, Oct 23, 2011 at 10:51 PM, Stéphane Ducasse <[hidden email]> wrote:
> how?
>
> Stef
>
> On Oct 21, 2011, at 11:26 PM, Mariano Martinez Peck wrote:
>
> > Thanks guys. I was able to successfully change the directory of the package-cache.
> >
> > On Fri, Oct 21, 2011 at 12:15 PM, Lukas Renggli <[hidden email]> wrote:
> > You could add startup code that resets it to an absolute fixed location.
> >
> > I would go with the links.
> >
> > Lukas
> >
> > On 21 October 2011 11:59, Sven Van Caekenberghe <[hidden email]> wrote:
> > >
> > > On 21 Oct 2011, at 11:47, Mariano Martinez Peck wrote:
> > >
> > >> Hi guys. I would really LOVE to have a shared package-cache among images. I have (really) 1 gb of .mcz in different package-cache.
> > >> I am using new images all the time (hence package cache is empty). I would love to be able to reuse the same package-cache directory for all my images.
> > >> So...how can I change the place where the package-cache is created so that it uses another directory?
> > >
> > > Mine is 0.75 GB, but shared: I put all my images in the same directory.
> > > Working with links is also an option, I think that is what Lukas' build scripts do.
> > >
> > > Sven
> > >
> > >
> > >
> >
> >
> >
> > --
> > Lukas Renggli
> > www.lukas-renggli.ch
> >
> >
> >
> >
> > --
> > Mariano
> > http://marianopeck.wordpress.com
> >
>
>
>
>
>
> --
> Mariano
> http://marianopeck.wordpress.com
>
>
>
>
> --
> Mariano
> http://marianopeck.wordpress.com
>


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Having a shared package-cache Re: MCDirectoryRepository defaultDirectoryName ignored?

Sean P. DeNigris
Administrator
In reply to this post by Mariano Martinez Peck
Mariano Martinez Peck wrote
MCCachedRepository >> marianoDefaultWithDirectory: aDirectory
    self checkCacheDirectory.
    ^ default ifNil: [default := self new directory: aDirectory]
I don't think you need to do all this (the checkCacheDirectory and ifNil: checks are on the old value you're throwing away). How about:

    MCCacheRepository>>default: aFileDirectory

        default := self new directory: aFileDirectory.

Then you won't need to do the reset, and it's general enough to include in the image w/o extension methods. A setting would be nice too :) I'll rename my other setting to avoid confusion (I already created an issue).

Issue 5067: Make package cache location changeable
http://code.google.com/p/pharo/issues/detail?id=5067

I added #default: but not the setting
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Having a shared package-cache Re: MCDirectoryRepository defaultDirectoryName ignored?

Mariano Martinez Peck


On Wed, Dec 7, 2011 at 2:48 AM, Sean P. DeNigris <[hidden email]> wrote:

Mariano Martinez Peck wrote
>
> MCCachedRepository >> marianoDefaultWithDirectory: aDirectory
>     self checkCacheDirectory.
>     ^ default ifNil: [default := self new directory: aDirectory]
>
I don't think you need to do all this (the checkCacheDirectory and ifNil:
checks are on the old value you're throwing away). How about:

   MCCacheRepository>>default: aFileDirectory

       default := self new directory: aFileDirectory.

Then you won't need to do the reset, and it's general enough to include in
the image w/o extension methods. A setting would be nice too :) I'll rename
my other setting to avoid confusion (I already created an issue).

Issue 5067:     Make package cache location changeable
http://code.google.com/p/pharo/issues/detail?id=5067

I added #default: but not the setting


Yes, and you can also directly execute:

MCCacheRepository default
directory: (FileDirectory on:  '/Users/mariano/Pharo/sharedRepo').


 
--
View this message in context: http://forum.world.st/Having-a-shared-package-cache-Re-MCDirectoryRepository-defaultDirectoryName-ignored-tp3924814p4167328.html
Sent from the Pharo Smalltalk mailing list archive at Nabble.com.




--
Mariano
http://marianopeck.wordpress.com

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Having a shared package-cache Re: MCDirectoryRepository defaultDirectoryName ignored?

Sean P. DeNigris
Administrator
Mariano Martinez Peck wrote
MCCacheRepository default
directory: (FileDirectory on:  '/Users/mariano/Pharo/sharedRepo').
If you just change the directory on the default instance, it would not reset the rest of the instance's state e.g. the 'cache' instVar. I don't know if that matters.
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Having a shared package-cache Re: MCDirectoryRepository defaultDirectoryName ignored?

Mariano Martinez Peck


On Wed, Dec 7, 2011 at 5:25 PM, Sean P. DeNigris <[hidden email]> wrote:

Mariano Martinez Peck wrote
>
> MCCacheRepository default
> directory: (FileDirectory on:  '/Users/mariano/Pharo/sharedRepo').
>

If you just change the directory on the default instance, it would not reset
the rest of the instance's state e.g. the 'cache' instVar. I don't know if
that matters.

I have no idea :(

 

--
View this message in context: http://forum.world.st/Having-a-shared-package-cache-Re-MCDirectoryRepository-defaultDirectoryName-ignored-tp3924814p4169535.html
Sent from the Pharo Smalltalk mailing list archive at Nabble.com.




--
Mariano
http://marianopeck.wordpress.com

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Having a shared package-cache Re: MCDirectoryRepository defaultDirectoryName ignored?

Sean P. DeNigris
Administrator
Mariano Martinez Peck wrote
I have no idea :(
Probably not worth wading through to find out. I'll just keep #default: and add a setting.
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Having a shared package-cache Re: MCDirectoryRepository defaultDirectoryName ignored?

Mariano Martinez Peck


On Wed, Dec 7, 2011 at 7:08 PM, Sean P. DeNigris <[hidden email]> wrote:

Mariano Martinez Peck wrote
>
> I have no idea :(
>

Probably not worth wading through to find out. I'll just keep #default: and
add a setting.


+1

 
--
View this message in context: http://forum.world.st/Having-a-shared-package-cache-Re-MCDirectoryRepository-defaultDirectoryName-ignored-tp3924814p4169914.html
Sent from the Pharo Smalltalk mailing list archive at Nabble.com.




--
Mariano
http://marianopeck.wordpress.com

Loading...