Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4937

Raspberry Pi OS • Re: apt dependency loops?

$
0
0
Shouldn't dependencies be loop free?
There's no real reason they shouldn't have loops.

If package A and B are both required for each to work, then A depending on B and B depending on A is fine. Install either and the other gets installed to satisfy the dependency.

There's no real "loop" here.
Thanks, that makes sense.

I wanted to get a picture of the dependencies and used new bash script "mkgraphviz" ...

Code:

#!/bin/bashecho -e "digraph {\nrankdir=LR\nnode [shape=box]"for p in `cat a`dofor d in `cat depends/$p`do  echo "\"$p\" -> \"$d\""donedoneecho "}"
... to create a graphviz dependency digraph and determine its connected components:

Code:

pi@raspberrypi5:~/packages $ ./mkgraphviz > gra.dotpi@raspberrypi5:~/packages $ ccomps gra.dot > ccs.dotpi@raspberrypi5:~/packages $

To my surprise the graph is not connected.
But the 4 components other than the very big connected component 0 are small.
I deleted connected component 0 and did draw the graph with GraphvizFiddle.
Below is the result, can be vieweed in browser with GrapvizFidddle share link as well:
Screenshot from 2024-09-10 22-55-24.png

I get no nice picture of the unmodified created graph with neither dot nor neato layout engines.
But the edges of the reported circles from last to first vertex are a "feedback arc set".
The removal creates a DAG (Directed Acyclic Graph) and there are algorithms to draw them nicely.

Statistics: Posted by HermannSW — Tue Sep 10, 2024 8:58 pm



Viewing all articles
Browse latest Browse all 4937

Trending Articles