Bug#335925: apt-cache rdepends shows duplicated reverse dependencies/dependants
(sorry for answering so late)
On Fri, Feb 18, 2011 at 09:28, Ishan Jayawardena <udeshike@gmail.com> wrote:
> I tried to fix the issue and this seems to work fine with --recurse as
> well. I attached a patch and the modified testcase that David wrote
> earlier.
The second test read like this:
testequal 'libc6
Reverse Depends:
Depends: apt
Recommends: apt-doc
| Conflicts: libc-bin
Depends: libc-bin
Suggests: libc5' aptcache rdepends libc6 -o APT::Cache::ShowDependencyType=1
This somehow suggests that libc-bin has an or-group conflict.
If we look at it it is apt-doc which recommends libc5 or libc6,
so the or comes from the recommends above. That is a bit misleading
(especially if the dependency type is not shown as its the default).
Displaying the or before apt-doc (old-style) has the benefit that you can
see immediately that libc6 is optional for apt-doc as we could install
another package to satisfy the dependency. Displaying it in the next
line (your style) never make sense in rdepends as the next line is always
independent as no package will have a Depends: libc6 | libc6
(i think dpkg-something at buildtime of the package would remove it).
For depends on the other hand your style has a certain appeal as
here the | as the or-group marker serves the propose of indicating what
the next line is: Another member of the or-group or independent.
Lets name it prefix-style. Your style is then postfix as it indicates
if the package on the current line is in an or-group with the package
on the line before.
Postfix should be easier to understand for humans with their random
access devices (=eyes) while a (simple) script reading output line by
line will favor prefix - even visible in your code as you jump through
quite a few loops to print postfix.
> With my modifications, apt-cache will output the result in the above
> format. Please correct me if this is not the required output or if I
> have misunderstood. I would like to know your feedback.
All in all, i am not sure if postfix printing is worth the hassle now.
It has the potential of increasing the complexity for script with no direct
gain, so to avoid being flamed it would need to be optional - which
means properly also non-default to not break existing scripts
(and documentation in forum, blogs, …).
On the other hand a human is perfectly able to read both styles easily
and therefore will not switch to non-default style…
It might change then we have an 'apt' binary which is only used by
users. This one could be way more volatile in its output…
But yeah, thats independent from the bugreport itself, as this one is
only talking about duplicates, not about pre-/postfix printing and not
about merging virtual providers to one line.
So, to get back to the original bugreport and prefix display:
It should be relatively easy to check before printing the | if
another package in this or-group was not printed until now, too.
Best regards
David Kalnischkies
P.S. : For the patch itself: I noticed that the part has a wrong indent-level
by default. Thats a bit misfortune, but its better to keep it that way
as changes which just massively change indent are hard to review.
Just look at your own diff and try to tell me what you really changed. ;)
Reply to: