Tom Mueller (pkg-discuss) wrote:
> Bart,
> Even though the code for this change has already checked been checked 
> into the gate, I had a couple of questions/comments.
> 
> constraint.py:
> line 239: has the following:
>                                 raise Constraint.Exception(
>                                     ConstraintException.PRESENCE_CONFLICT,
>                                     self, fmri_present)
> 
> It seems that the "Constraint.Exception" right after "raise" should be 
> "ConstraintException".

Yes.  We cannot hit this right now, because we don't yet handle exclude
dependencies correctly, and have no test cases for them.

> 
> Also, at line 260, an exception with the PRESENCE_CONFLICT type is 
> created with the 3rd argument being a Constraint object rather than an 
> PkgFmri as is used here. While it appears that this will work, at least 
> as far as printing an error message (because they both implement 
> __str__, it isn't clear that this is what is desired.
> 
This was less than ideal but it works as you note.

> image.py:
> line 1652: In the get_installed_unbound_inc_list method, the inc_tuples 
> list is populated with tuples containing pairs of package names (the 
> depender and the dependee). But the second element of the tuple is never 
> used. So why use a tuple here at all?  Why not just store the fmri_name 
> values in the list? This would eliminate the need to extract the first 
> elements of the tuples at the end of the method. If an inc list contains 
> the list of fmri_name values, then it would seem that the end of the 
> method could just be:
> 
>     rv = set()
>     for a in inc:
>        if not a in dependents:
>           rv.add(a)
>     return list(rv)
>

The algorithm changed here; I agree that with the current simple
exclusion of any depended-upon incorporation, the current code is
slightly more complex than needed.  The original implementation
was going to be a topological sort; right now that isn't necessary
so the tuple isn't needed at this point.

- Bart

-- 
Bart Smaalders                  Solaris Kernel Performance
[EMAIL PROTECTED]               http://blogs.sun.com/barts
"You will contribute more with mercurial than with thunderbird."
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to