[csw-maintainers] Modifying check for /usr/share

Maciej (Matchek) Bliziński maciej at opencsw.org
Mon Apr 15 19:11:07 CEST 2013


2013/4/15 Dagobert Michelsen <dam at opencsw.org>:
> I would like to keep the check, there have been occasions where this was extremely useful
> and helped point out issues which were gone by unnoticed. Taking out the known-to-be-good
> pathes is IMHO the best way.

OK, so we're keeping the check and adding a whitelist. The change
needs to go as deep as metadata collection, because we're grepping for
predetermined strings. We also need to figure out how to represent
this, e.g. what's the outcome if we have two occurrences, one good and
one bad; and what if the bad one is a substring of the good one (!).
I'm not saying this is hard, just that it has to be programmed
correctly (unit tests are strongly encouraged).

One change will go into package_stats.py around line 29[1] where we
define what we're grepping for. Except now not all regexes will be
markers of 'bad' any more, so we might want to rename the variable.
Then in package_checks.py line 773[2] there will be a modification
which will apply some logic, where it'll look at what regexes matched
and make a decision whether to throw an error or not. That's where
tests are essential, because we need to make sure that we're covering
both common and corner cases.

I'm guessing it's a simple enough change, so I'll let you guys knock
yourselves out with Python coding, but do send your patch out for
review before you commit it. We make sure that the code is readable
for other humans.

Maciej

[1] https://sourceforge.net/apps/trac/gar/browser/csw/mgar/gar/v2/lib/python/package_stats.py#L29
[2] https://sourceforge.net/apps/trac/gar/browser/csw/mgar/gar/v2/lib/python/package_checks.py#L773


More information about the maintainers mailing list