On 05/12/11 02:13 PM, Danek Duvall wrote:
Shawn Walker wrote:

   http://cr.opensolaris.org/~swalker/pkg-composite-2/

catalog.py:

   - line 3411: this disallows ver == 0, if I'm reading it correctly.

Since it is always supposed to be a string (per docstring), no. But even then, 'ver' will never be just 0 for our use (it'll always be something like 1.0,5.11, etc.):

$ python -c "assert '0'"
$

...
publisher.py:

   - line 1238,1239: First "list", then "set", plus the name of the method?

It doesn't mean "set" literally (as in the data type). This is the logical sort of set; perhaps 'combo' instead of 'set'?

   - line 1313: urlencoding instead of hashing the uri would make for easier
     debugging.  Hm.  Maybe move the comment on line 1319 up here?  And
     perhaps only hash if the name is too long?  I doubt it'll happen too
     often, and there won't be any conflict.

I'd rather not go there; it is preferable to me to be consistent and avoid the path length issues entirely. I'd be willing to write out the URI into a file in the directory for debugging purposes though if it's really that important.

   - line 1376: this doesn't look like it'll be a relative link, but it
     should be.

Thanks for catching that.

   - line 1377: no need to symlink "attrs"?

No, 'attrs' is catalog v0, 'catalog.attrs' is v1. If retrieving a v0 catalog from a v0 source, it will be converted to v1 as well, so again, no v0 files to link.

   - line 1426,1431: I don't see how these are defined differently.  Won't
     line 1437 always evaluate False?  Should src_sigs be defined before
     line 1421?

Line 1428 should have said 'sentry' instead of 'entry'.

   - line 1479: wouldn't 'if PKG_STATE_V0 not in mdata["states"]" represent
     what you're actually trying to do better, or am I misunderstanding how
     the list of states works?

No. This logic is attempting say that if *any* of the sources are V1, then I don't need the state data because at least one source provides the package data needed, so marking the entry with PKG_STATE_V0 is undesirable.

   - line 1487: I don't see how this could ever be True.  It would have to
     be either None or an empty dict, and in either case, the tests on lines
     1473, 1479, or 1484 would have blown up.

Yes, it could be an empty dict in the event that all sources provide a package (line 1473) and they are all V1 sources (line 1479). At that point it *becomes* an empty dict -- it didn't start that way. This simply reduces the amount of data that gets serialised.

Thanks,
-Shawn
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to