Jeff Johnson: >>> Header tags _ARE_ ordered, just the collation isn't >>> what no brainer conversions into native data types >>> are implementing.
> And the collation is integer numeric based on tag numbers. Okay. Does this tag ordering need to be preserved ? If so, we should change the --yaml and --json now. > There's a s superficial and a deep answer here. > > SOmehow it needs to be indicated that header speawage > is _NOT_ random, but rather carefully sorted in many > ways. All the sequences/arrays maintain their sort order, but the mappings/objects do not (they're unordered) > The "LSB packaging standard" totally blew it with respect to > tag ordering. > > And the spewage -- if not carefully controlled -- will be useless > for RPM itself, whose task is to import/export through speawage > into a "header" blob. If spewage is to preserve tag ordering, then the currently used markup/schema needs to be changed. From: { Tag1: Value1, Tag2: Value2, Tag3: Value3 } To: [ { Tag1: Value1 }, { Tag2: Value2 }, { Tag3: Value3 } ] This will make it slightly trickier to handle, but it will preserve the order of the keys/tags. >>> But it hardly matters with spewage, fewer tokens to ask >>> about KISS simplicity trumps everything else in FL/OSS. >> >> For the YAML and JSON formats, it's easier unordered. > > Easier for whom? Lusers who don't undertsand what > "canoniocally represented plaintext" actually means? > > Or why sorted data can be accessed in logN not linear time? Easier formats, i.e. not needing nested structures ? But if it's needed, it's needed. I thought it wasn't. >> And I think the XML would need a DTD, to do ordering ? >> > > No idea what XML "needs". I do know from rpmrepo that > its _IMPOSSIBLE_ to be bit for bit compatible because > tag data is being run through a python dict which > _DESTROYS_ the ordering of the original data. Right. The same goes for using a mongo document iirc ? >> i.e. XML does ordering now, but I think a parser is >> "free" to reorder the elements without invalidating ? >> > > Please note that I'm disagreeing with your patch whatsoever. > > But somehow and somewhere it needs to be hinted to all > the "spewage suckers" that there are most definitely > performance and interoperability wins by establishing > a sorted and canonical ordering on the spewage items. > > Yes I know how to use qsort(3) wherever needed. I'm enetrested > in proper spewage specification on which it becomes feasible > to define digests/signatures and simplify interoperability > and implementations. And most definitely I'm not holding my breath > waiting for FedEx to ship me a pony ... If metadata must be sorted, it should be specified and required by any export/import (in any format). Was under the impression that it was only "needed" for arrays like Requires/Files, but probably wrong. --anders ______________________________________________________________________ RPM Package Manager http://rpm5.org Developer Communication List rpm-devel@rpm5.org