<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Oct 8, 2014 at 6:20 PM, Chris Muller <span dir="ltr">&lt;<a href="mailto:ma.chris.m@gmail.com" target="_blank">ma.chris.m@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class="">On Wed, Oct 8, 2014 at 8:05 PM, Eliot Miranda &lt;<a href="mailto:eliot.miranda@gmail.com">eliot.miranda@gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt;<br>
&gt; On Wed, Oct 8, 2014 at 5:59 PM, Chris Muller &lt;<a href="mailto:asqueaker@gmail.com">asqueaker@gmail.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; Hi, I&#39;m sure it would help to understand the broader context of why<br>
&gt;&gt; the .mcd doesn&#39;t meet your needs.  I assume you must have some<br>
&gt;&gt; external (non-Smalltalk) tool unzipping the mcz to get at the<br>
&gt;&gt; contents?  Because if you were only accessing via the MCRepository<br>
&gt;&gt; API&#39;s then mcd shouldn&#39;t matter.<br>
&gt;<br>
&gt;<br>
&gt;  The Spur bootstrap depends on being able to generate patched files.  I<br>
&gt; could, had I known the syetem better, have produced those patches as mcd&#39;s,<br>
&gt; but have produced them as .mczs.<br>
<br>
</span>Okay, but when you generate those patched mcd&#39;s, they are still based<br>
off the prior version, so I&#39;m still having trouble understanding why<br>
Spur bootstrap would have any trouble reading a mcd..<br></blockquote><div><br></div><div>I don&#39;t generate patches mcds.  I generate patched mczs.  The issue is that some versions are only available as mcds and need to be cnverted into mczs before they can be patched.  An annoying associated issue is that the query available version interface blurs the distinction between mczs and mcds so if you ask for an mcz and the repository has an mcd it&#39;ll tell you it has the version but it doesn&#39;t.  It only has the mcd.  Further there&#39;s no convenient way to get the mcz form the mcd.  Thats why I had to write the below, that constructs the full mcz form the mcd.</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<span class=""><br>
&gt;IMO mcd is a premature optimization,<br>
&gt; saving a littel bit<br>
&gt;<br>
&gt;&gt; I think you&#39;re on the right track with the<br>
&gt;&gt;<br>
&gt;&gt;    cacheRepo storeVersion: (repo versionNamed: versionName).<br>
&gt;&gt;<br>
&gt;&gt; approach, because that lets the Repository &quot;do its job&quot; the way it<br>
&gt;&gt; wants or needs to, able to assume its users would only care about the<br>
&gt;&gt; objects returned, not its private, internal storage format.<br>
&gt;<br>
&gt; There really should be an &quot;If I say store a version I mean it&quot; API that<br>
&gt; means that diffy versions can be stored.  It&#39;s a PITA not having this.<br>
<br>
</span>It&#39;s an internal format that&#39;s supposed to be invisible to users of<br>
Repository&#39;s.  I think exposing it could create PITA&#39;s..<br></blockquote><div><br></div><div>mcd is *not* an internal format.  If one interacts with repositories and asks for mczs one gets given mcds if these are what&#39;s available.  It would be *great* if they were an internal format but I assure you they&#39;re not.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<span class=""><br>
&gt;&gt; There is a &#39;alwaysStoreDiffs&#39; option for every Repository, so it might<br>
&gt;&gt; help to make sure that&#39;s turned off on your CacheRepository.  But I<br>
&gt;&gt; know that&#39;s not what you want if the incoming is _already_ a mcd,<br>
&gt;&gt; because you want a &#39;alwaysStoreFull&#39;, but I&#39;m not sure why..<br>
&gt;<br>
&gt;<br>
&gt; Um, the cache repository&#39;s value is indeed false (actually nil, which<br>
&gt; defaults to false).  But the storeVersion code doesn&#39;t pay attention to that<br>
&gt; flag.<br>
<br>
</span>Yes it does, it calls #prepareVersionForStorage: which checks it.  As<br>
I said, it won&#39;t convert a mcd to a mcz, it will only convert a mcz to<br>
a mcd, which Spur should be able to read just fine assuming the<br>
ancestor of the patched package is available in a repository...?<br></blockquote><div><br></div><div>Did you see my comment below re basicStoreVersion: ?  Prepare version for storage will arrange to store a diffy version from a full version, but it *won&#39;t* arrange to store a full version from a diffy version.  But later on MCCacheRepository &gt;&gt;basicStoreVersion: refuses to store anything anyway.  I wouldn&#39;t have written the below if mcd&#39;s weren&#39;t a problem.  I&#39;m not a masochist ;-)</div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div class=""><div class="h5">&gt;&gt; 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;<br>
&gt;&gt; wrote:<br>
&gt;&gt; &gt; OK here&#39;s what I came up with, and it&#39;s not pretty.  But it is useful.<br>
&gt;&gt; &gt; Should this be included in MCCacheRepository or MCFileBasedRepository as<br>
&gt;&gt; &gt; a<br>
&gt;&gt; &gt; general facility?  IMO, yes, to have some poor soul going down this same<br>
&gt;&gt; &gt; route.  But I want to canvas opinion first.  Nte that one wpould think<br>
&gt;&gt; &gt; all<br>
&gt;&gt; &gt; one had to do was<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; cacheRepo storeVersion: (repo versionNamed: versionName).<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; but MCCacheRepository defeats that simple route with<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; MCCacheRepository &gt;&gt;basicStoreVersion: aVersion<br>
&gt;&gt; &gt; (aVersion isCacheable not or: [self allFileNames includes: aVersion<br>
&gt;&gt; &gt; fileName])<br>
&gt;&gt; &gt; ifFalse: [super basicStoreVersion: aVersion]<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; So that leaves the brute-force:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; cachedNonDiffyVersionNamed: versionName from: repo<br>
&gt;&gt; &gt; &quot;Make sure that the cache contains a non-diffy version of versionName<br>
&gt;&gt; &gt; and<br>
&gt;&gt; &gt; answer it.&quot;<br>
&gt;&gt; &gt; | cacheRepo |<br>
&gt;&gt; &gt; self assert: (versionName endsWith: &#39;.mcz&#39;).<br>
&gt;&gt; &gt; cacheRepo := MCCacheRepository default.<br>
&gt;&gt; &gt; &quot;Make sure that at least the diffy (.mcd) version is present&quot;<br>
&gt;&gt; &gt; (cacheRepo directory includesKey: versionName) ifFalse:<br>
&gt;&gt; &gt; [cacheRepo storeVersion: (repo versionNamed: versionName)].<br>
&gt;&gt; &gt; &quot;if after storeVersion there&#39;s still no .mcz we need to create one;<br>
&gt;&gt; &gt; sigh...&quot;<br>
&gt;&gt; &gt; (cacheRepo directory includesKey: versionName) ifFalse:<br>
&gt;&gt; &gt; [| baseName diffyVersionName diffyVersion file delete |<br>
&gt;&gt; &gt; baseName := versionName allButLast: 4. &quot;strip .mcz&quot;<br>
&gt;&gt; &gt; diffyVersionName := cacheRepo directory fileNames detect: [:fn| (fn<br>
&gt;&gt; &gt; endsWith: &#39;.mcd&#39;) and: [(fn copyUpTo: $() = baseName]].<br>
&gt;&gt; &gt; diffyVersion := cacheRepo versionNamed: diffyVersionName.<br>
&gt;&gt; &gt; file := cacheRepo directory newFileNamed: versionName.<br>
&gt;&gt; &gt; delete := false.<br>
&gt;&gt; &gt; [file binary.<br>
&gt;&gt; &gt;  [MCMczWriter fileOut: diffyVersion on: file]<br>
&gt;&gt; &gt; on: Error<br>
&gt;&gt; &gt; do: [:ex|<br>
&gt;&gt; &gt; delete := true. &quot;don&#39;t leave half-formed .mcz files around to screw<br>
&gt;&gt; &gt; things<br>
&gt;&gt; &gt; up later on...&quot;<br>
&gt;&gt; &gt; ex pass]]<br>
&gt;&gt; &gt; ensure:<br>
&gt;&gt; &gt; [file close.<br>
&gt;&gt; &gt; delete ifTrue:<br>
&gt;&gt; &gt; [cacheRepo directory deleteFileNamed: versionName]].<br>
&gt;&gt; &gt; &quot;now delete the damn diffy version that caused all the pain in the first<br>
&gt;&gt; &gt; place&quot;<br>
&gt;&gt; &gt; delete ifFalse:<br>
&gt;&gt; &gt; [cacheRepo directory deleteFileNamed: diffyVersionName].<br>
&gt;&gt; &gt; cacheRepo cacheAllFilenames].<br>
&gt;&gt; &gt; ^cacheRepo versionNamed: versionName<br>
&gt;&gt; &gt;<br>
&gt;&gt; &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;&gt; &gt; wrote:<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Hi All,<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;     so *how* do I ensure I have a .mcz when there appears to only be a<br>
&gt;&gt; &gt;&gt; .mcd?  I&#39;m talking about trying to get &#39;Kernel-ul.875.mcz&#39; from trunk<br>
&gt;&gt; &gt;&gt; when<br>
&gt;&gt; &gt;&gt; Kernel-ul.875(eem.872).mcd appears to be on offer.  If I try<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; MCCacheRepository default storeVersion: (trunk versionNamed:<br>
&gt;&gt; &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; &gt;&gt; repository.  I&#39;m f*&amp;^%d until I can get this working.  help, please!<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; --<br>
&gt;&gt; &gt;&gt; best,<br>
&gt;&gt; &gt;&gt; Eliot<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; --<br>
&gt;&gt; &gt; best,<br>
&gt;&gt; &gt; Eliot<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; best,<br>
&gt; Eliot<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>best,<div>Eliot</div>
</div></div>