Question to show-installed

Florian Festi ffesti at redhat.com
Mon Mar 9 12:16:50 UTC 2015


On 03/09/2015 12:02 AM, Harald Heigl wrote:
> Hi,
> 
> I've a question concerning show-installed (from yum-utils). This seems
> perfect to me to get a comprehensive list of all packages.
> As far as I can see it uses returnLeafNodes() which works for most
> cases, I've found just one point where it doesn't work as expected. (in
> my opinion)
> 
> I have two packages (or perhaps some more) which reference each other
> (circular reference), neither of them is shown up in this list, because
> they are both no leaf-node. How would I adjust show-installed the best
> way? I've thought about implementing something similar what "repoquery
> --installed --whatrequires --recursive" does and looking for a self
> reference in there and adding found packages to the list. 
> 
> But I think this would have great impact on performance of the script,
> are there any better ways? A build-in function, another yum-util, which
> could list circular referenced packages?
> I'm developer myself, but completely new to yum-api and python, so
> please keep this in mind.

I have dealt with dependency loops in rpm. The key words for efficient
implementation are "strongly connected component" [1]. In rpm I used
Tarjan's algorithm [2] to find them (and then break them up for ordering).

Be aware that any package in a SCC can be used as a "leaf" dragging in
the whole rest of the packages.

Florian

[1] http://en.wikipedia.org/wiki/Strongly_connected_component
[2]
http://en.wikipedia.org/wiki/Tarjan%27s_strongly_connected_components_algorithm


-- 

Red Hat GmbH, http://www.de.redhat.com/ Registered seat: Grasbrunn,
Commercial register: Amtsgericht Muenchen, HRB 153243,
Managing Directors: Charles Cachera, Michael Cunningham, Michael
O'Neill, Charles Peters


More information about the Yum-devel mailing list