Squeak map smart cache

Julian Fitzell julian at beta4.com
Sat Mar 15 22:53:51 UTC 2003


Bill Schwab wrote:
> Goran,
> 
> I'm glad to see that you are planning to include a smart cache soon.  If it's easy to do, it would be nice to have contrtol over the path to the cache directory, probably relative to the image directory.  SM already makes a subdirectory, but it still puts files (lots of them) in the image directory, and I would rather be able to prevent that for the benefit of my backup system.
> 

I actually fixed this in my image at work last week.

I figured I wouldn't post it because Goran is working busily on the new 
SqueakMap but since there may be interest I'll post it anyway.

This changeset does the following:

* changes all instvar references to downloadDirectory in SMLoader to use 
an accessor method
* changes SMLoader#on: so it doesn't statically set the directory from 
the SMSqueakMap instance
* changes SMLoader#downloadDirectory to return the directory provided by 
its squeakMap instance unless you have manually overridden it from the 
context menu
* adds SMSqueakMap#installerForPackage: which gets an installer for the 
package with the directory got from the #directory method.
* changes SMSqueakMap#installPackageNamed: and #installPackageWithId: to 
call #installerForPackage: instead of duplicating code and forcing the 
use of the default directory in each case.

The end result is that packages are downloaded to the sm/ directory 
inside whatever the default directory is.  We thought about adding a 
subdirector inside sm/ and adding another method to SMSqueakMap to get 
that directory but it didn't seem worth it.

This also fixes the problem that occurred when you moved an image to 
another location or computer with a different path and still had an 
SMLoader instance open.  You can still force an override if you want but 
the default is now dynamic and much better, in my opinion.

Julian


-- 
julian at beta4.com
Beta4 Productions (http://www.beta4.com)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sm-relative-cache-dir-jf_and_ac.cs.gz
Type: application/x-gzip
Size: 853 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20030315/ecb1c76f/sm-relative-cache-dir-jf_and_ac.cs.bin


More information about the Squeak-dev mailing list