<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Oct 8, 2014 at 5:59 PM, Chris Muller <span dir="ltr">&lt;<a href="mailto:asqueaker@gmail.com" target="_blank">asqueaker@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi, I&#39;m sure it would help to understand the broader context of why<br>
the .mcd doesn&#39;t meet your needs.  I assume you must have some<br>
external (non-Smalltalk) tool unzipping the mcz to get at the<br>
contents?  Because if you were only accessing via the MCRepository<br>
API&#39;s then mcd shouldn&#39;t matter.<br></blockquote><div><br></div><div> The Spur bootstrap depends on being able to generate patched files.  I could, had I known the syetem better, have produced those patches as mcd&#39;s, but have produced them as .mczs.  IMO mcd is a premature optimization, saving a littel bit</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I think you&#39;re on the right track with the<br>
<span class=""><br>
   cacheRepo storeVersion: (repo versionNamed: versionName).<br>
<br>
</span>approach, because that lets the Repository &quot;do its job&quot; the way it<br>
wants or needs to, able to assume its users would only care about the<br>
objects returned, not its private, internal storage format.<br></blockquote><div><br></div><div>There really should be an &quot;If I say store a version I mean it&quot; API that means that diffy versions can be stored.  It&#39;s a PITA not having this.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
There is a &#39;alwaysStoreDiffs&#39; option for every Repository, so it might<br>
help to make sure that&#39;s turned off on your CacheRepository.  But I<br>
know that&#39;s not what you want if the incoming is _already_ a mcd,<br>
because you want a &#39;alwaysStoreFull&#39;, but I&#39;m not sure why..<br></blockquote><div><br></div><div>Um, the cache repository&#39;s value is indeed false (actually nil, which defaults to false).  But the storeVersion code doesn&#39;t pay attention to that flag.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5"><br>
<br>
On Wed, Oct 8, 2014 at 7:37 PM, Eliot Miranda &lt;<a href="mailto:eliot.miranda@gmail.com">eliot.miranda@gmail.com</a>&gt; wrote:<br>
&gt; OK here&#39;s what I came up with, and it&#39;s not pretty.  But it is useful.<br>
&gt; Should this be included in MCCacheRepository or MCFileBasedRepository as a<br>
&gt; general facility?  IMO, yes, to have some poor soul going down this same<br>
&gt; route.  But I want to canvas opinion first.  Nte that one wpould think all<br>
&gt; one had to do was<br>
&gt;<br>
&gt; cacheRepo storeVersion: (repo versionNamed: versionName).<br>
&gt;<br>
&gt; but MCCacheRepository defeats that simple route with<br>
&gt;<br>
&gt; MCCacheRepository &gt;&gt;basicStoreVersion: aVersion<br>
&gt; (aVersion isCacheable not or: [self allFileNames includes: aVersion<br>
&gt; fileName])<br>
&gt; ifFalse: [super basicStoreVersion: aVersion]<br>
&gt;<br>
&gt; So that leaves the brute-force:<br>
&gt;<br>
&gt; cachedNonDiffyVersionNamed: versionName from: repo<br>
&gt; &quot;Make sure that the cache contains a non-diffy version of versionName and<br>
&gt; answer it.&quot;<br>
&gt; | cacheRepo |<br>
&gt; self assert: (versionName endsWith: &#39;.mcz&#39;).<br>
&gt; cacheRepo := MCCacheRepository default.<br>
&gt; &quot;Make sure that at least the diffy (.mcd) version is present&quot;<br>
&gt; (cacheRepo directory includesKey: versionName) ifFalse:<br>
&gt; [cacheRepo storeVersion: (repo versionNamed: versionName)].<br>
&gt; &quot;if after storeVersion there&#39;s still no .mcz we need to create one; sigh...&quot;<br>
&gt; (cacheRepo directory includesKey: versionName) ifFalse:<br>
&gt; [| baseName diffyVersionName diffyVersion file delete |<br>
&gt; baseName := versionName allButLast: 4. &quot;strip .mcz&quot;<br>
&gt; diffyVersionName := cacheRepo directory fileNames detect: [:fn| (fn<br>
&gt; endsWith: &#39;.mcd&#39;) and: [(fn copyUpTo: $() = baseName]].<br>
&gt; diffyVersion := cacheRepo versionNamed: diffyVersionName.<br>
&gt; file := cacheRepo directory newFileNamed: versionName.<br>
&gt; delete := false.<br>
&gt; [file binary.<br>
&gt;  [MCMczWriter fileOut: diffyVersion on: file]<br>
&gt; on: Error<br>
&gt; do: [:ex|<br>
&gt; delete := true. &quot;don&#39;t leave half-formed .mcz files around to screw things<br>
&gt; up later on...&quot;<br>
&gt; ex pass]]<br>
&gt; ensure:<br>
&gt; [file close.<br>
&gt; delete ifTrue:<br>
&gt; [cacheRepo directory deleteFileNamed: versionName]].<br>
&gt; &quot;now delete the damn diffy version that caused all the pain in the first<br>
&gt; place&quot;<br>
&gt; delete ifFalse:<br>
&gt; [cacheRepo directory deleteFileNamed: diffyVersionName].<br>
&gt; cacheRepo cacheAllFilenames].<br>
&gt; ^cacheRepo versionNamed: versionName<br>
&gt;<br>
&gt; On Wed, Oct 8, 2014 at 4:12 PM, Eliot Miranda &lt;<a href="mailto:eliot.miranda@gmail.com">eliot.miranda@gmail.com</a>&gt;<br>
&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; Hi All,<br>
&gt;&gt;<br>
&gt;&gt;     so *how* do I ensure I have a .mcz when there appears to only be a<br>
&gt;&gt; .mcd?  I&#39;m talking about trying to get &#39;Kernel-ul.875.mcz&#39; from trunk when<br>
&gt;&gt; Kernel-ul.875(eem.872).mcd appears to be on offer.  If I try<br>
&gt;&gt;<br>
&gt;&gt; MCCacheRepository default storeVersion: (trunk versionNamed:<br>
&gt;&gt; &#39;Kernel-ul.875.mcz&#39;) I *do not* get a &#39;Kernel-ul.875.mcz&#39; in my cache<br>
&gt;&gt; repository.  I&#39;m f*&amp;^%d until I can get this working.  help, please!<br>
&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt; best,<br>
&gt;&gt; Eliot<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; best,<br>
&gt; Eliot<br>
&gt;<br>
&gt;<br>
&gt;<br>
<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>best,<div>Eliot</div>
</div></div>