On Thu, Jul 07, 2011 at 10:16:46AM +1200, Tim Foster wrote:
> Hi all,
> 
> I've a short code review here that adds support to pkglint to have it
> run action validate() methods, and deal with file 'overlay' attributes.
> 
> 18397 pkglint needs to cope with 'overlay' attributes on files
> 18627 pgklint should run action validate methods
> 
> https://cr.opensolaris.org/action/browse/pkg/timf/pkglint-overlay-validate/pkglint-overlay-validate-webrev/
> 


src/modules/lint/pkglint_action.py

- you frequently do checks like:

        if allow_attr and allow_attr == "..."
        if overlay_attr and overlay_attr == "..."

  the first test seems unnecessary.

- in dup_attr_check() it seems like you could reduce a lot of indentation by 
changing:

        if conflict_actions:

  checks into:

        if not conflict_actions:
                processed_dic[name] = True
                return

- in dup_attr_check(), you do:

 404                         conflict_actions, errors = _prune_overlays(
 405                             conflict_actions, ref_dic)
 ...
 413                         if conflict_actions:
 414                                  conflict_vars, conflict_actions = \
 415                                         self.conflicting_variants(actions,
 416                                             pkg_vars)

  so if there are conflicting overlays, you don't bother to report just
  the conflicting overlay actions, instead you continue on and process
  all conflicting actions (regardless of if they use overlays), right?
  this seems ok, but some comments explaining it might be nice.

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

Reply via email to