On Mon, 2018-07-09 at 08:59 +0000, Michael Schroeder wrote: > I tought about this a bit more over the weekend, and maybe we > should do this in a bit more general way. Basically zchunk is > just another compression format, like "xz" or "zstd". If we > want to support yet another compression format, we proably wouldn't > want to add new attributes to the existing elements, but instead > add new elements. E.g. > > <data type="primary"> > <location href="...primary.gz" /> > <checksum type="sha256">...</checksum> > </data> > <data type="primary" compression="xz"> > <location href="...primary.xz" /> > <checksum type="sha256">...</checksum> > </data> > > We might also want to add a "format" attribute in case we want > to get switch from "xml" to something that can be parsed faster, > like "json". > > The zchunk compression format would be the same, but with added > "header-size" and "header-checksum" elements (so back to what > you had earier): > > <data type="primary" compression="zchunk"> > <location href="...primary.zck" /> > <checksum type="sha256">...</checksum> > <timestamp>...</timestamp> > <size>...</size> > <open-size>...</open-size> > <open-checksum type="sha256">...</open-checksum> > <header-size>...</header-size> > <header-checksum type="sha256">...</header-checksum> > </data> > > The problem with all this is that we don't know how all the > repomd.xml parsers behave when there are multiple <data> elements > with the same type, so we might need to annotate the "type" with > the compression/format, e.g. "primary@zchunk".
I had originally planned to do something along these lines (I think I used primary-zck rather than primary@zchunk), but realized that this pushed the "choose best format" code into the top-level tools, rather than leaving the decision in librepo. I suppose if librepo grew the ability to understand that primary@zchunk matches primary, it could work, but that would take some work, I think. What would be worth the effort would be switching back to header-size and header-checksum, and making sure that createrepo can create zchunk- only metadata as well as the current plan of zchunk+gz metadata. In other words, we only use zck-loc and zck-timestamp if it's zchunk+gz. Jonathan _______________________________________________ Rpm-ecosystem mailing list Rpm-ecosystem@lists.rpm.org http://lists.rpm.org/mailman/listinfo/rpm-ecosystem