Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #228651

if you want to see Debian (no one have seen it before! ;-)

From Davide Prina <davide.prina@gmail.com>
Newsgroups linux.debian.user
Subject if you want to see Debian (no one have seen it before! ;-)
Date 2020-11-14 16:00 +0100
Message-ID <Bb5bY-2OM-3@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


Hi,

I'm not inscribed to debian-user, so if you want I read your replies 
then CC me
Also, very few of you (no more then 10 of the 2-3 people that will read 
this eamil) will note that I'm not a very good English writer.

I have seen that Tulip is reentered the Debian repository :-) and I made 
an exercise.

I used Tulip to visualize Debian packages and their dependencies.
For the impatient you can see the result here (but if you want to 
install Tulip, make your test or you want to understand more, then 
continue to read):
https://img.tedomum.net/data/Tulip1-a4ae06.png
https://img.tedomum.net/data/Tulip2-310791.png
https://img.tedomum.net/data/Tulip3-301ad3.png
https://img.tedomum.net/data/Tulip4-1126f4.png
https://img.tedomum.net/data/Tulip5-8a7fcc.png
https://img.tedomum.net/data/Tulip6-e5392f.png

Tulip is now in Debian testing (Bullseye) and unstable (Sid).

If you want to install and use Tulip you must also solve 3 bugs (I have 
already reported they):
After having installed Tulip
# apt install tulip

you must do the following three steps to correct 3 bugs:

1) wrong font symbolic link
as you can see here:
$ ls -l /usr/share/tulip/bitmaps/font.ttf

for correct the problem:
# rm /usr/share/tulip/bitmaps/font.ttf
# ln -s /usr/share/fonts/truetype/dejavu/DejaVuSans.ttf 
/usr/share/tulip/bitmaps/font.ttf

2) wrong font symbolic link
as you can see here:
$ ls -l /usr/share/tulip/bitmaps/fontb.ttf

for correct the problem:
# rm /usr/share/tulip/bitmaps/fontb.ttf
# ln -s /usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf 
/usr/share/tulip/bitmaps/fontb.ttf

3) missing dependency (if you run tulip from xterm you will get some 
error messages)
# apt install python3-sip

After that you must create nodes (packages) and edges (dependency).

You can download my files in ZIP format: 
https://catdrop.drycat.fr/r/6wJ12zKJ#CUItP72icXMRZiPPKx7B/R0rvKOlwQlJyqzvJooUjZE=
Note that they will be deleted after 30 days.

Or generate they with one small script

--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--
#!/bin/bash

PackageFile="/var/lib/apt/lists/deb.debian.org_debian_dists_testing_main_binary-amd64_Packages"
FileTmp="FileTemporaneo.txt"
Pacchetti="Pacchetti.txt"
PacchettiDipendenze="PacchettiDipendenze.txt"

grep "^Package: \|^Depends: " "$PackageFile" | sed "s/^Package: 
\(.*\)/\1__/;s/^Depends: //;s/ |/,/g;s/ 
([^(]*)//g;s/:[^,]*,/,/g;s/:[^,]*$//g"  > $FileTmp
#head -50 "$PackageFile" | grep "^Package: \|^Depends: "  | sed 
"s/^Package: \(.*\)/\1__/;s/^Depends: //;s/ |/,/g;s/ 
([^(]*)//g;s/:[^,]*,/,/g"  > $FileTmp
# | sed -e ':x /__$/ {N;s/__\n__/; /g ; bx}' | sed "s/__//;s/, /,/g" > 
$FileTmp

Prefisso=""
:>$Pacchetti
:>$PacchettiDipendenze
for i in $(cat $FileTmp); do
#echo "Leggo: <$i>"
  if [[ "$i" =~ __$ ]]; then
    Prefisso=$(echo "$i" | sed "s/__//")
    echo "$Prefisso" >> $Pacchetti
   else
    echo "$Prefisso,$i" | sed "s/,$//" >> $PacchettiDipendenze
  fi
done

sort $PacchettiDipendenze | uniq > $FileTmp
mv $FileTmp $PacchettiDipendenze
--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--

This script take the main Debian repository from a testing machine that 
use deb.debian.org as repository, if you use Sid or a different 
repository, then you must modify the content of the $PackageFile variable.

This script generate two file:
1) Pacchetti.txt <- the nodes
2) PacchettiDipendenze.txt <- the edges

The script is very slow.
I have try to generate rows of this type:
pacchettoN;dipendenza1N,dipendenza2N[,...]
and then break they into the following:
pacchettoN,dipendenza1N
pacchettoN,dipendenza2N
[...]
But I was unable to find a quick solution with sed or other command, so 
I have create the loop that is very slow.

Now you can start Tulip.

You can import first the nodes (Pacchetti.txt) and then the edges 
(PacchettiDipendenze.txt)... or you can import only the edges 
(PacchettiDipendenze.txt) and tell Tulip to create the missing nodes 
(during import), in this manner you don't import nodes without edges and 
so you have less elements and the program is faster. If you do this you 
can copy the nodes name from the viewLabel column.

After of the you will have two view:
* nodes/edges table view
* graph view

Here is the graph view:
https://img.tedomum.net/data/Tulip1-a4ae06.png

Some package in the top and lower right have few dependencies and the 
most of the package are at bottom left.
 From this graph you cannot get a lot of information.
Note that each red dot represent a Debian package and packages name are 
visualized only when there is enough space.

Using the left panel we can get a graph with more information.
For example if you execute the algorithm: Bubble Tree you get the 
following graph:
https://img.tedomum.net/data/Tulip2-310791.png

from the graph view I have hide the edges, elsewhere I will see a gray 
background and the program will be slower.

Here you can see that Debian in libc6 dependent.
In the top you can see that there are other packages with strong 
dependencies and if you enlarge this part you can see this:
https://img.tedomum.net/data/Tulip3-301ad3.png

You can see two big spheres with Perl and Python and other smaller spheres.
Also in the libc6 perimeter there are a lot of small spheres, and with a 
zoom we can see, for example:
r-base-core:
https://img.tedomum.net/data/Tulip4-1126f4.png

node.js:
https://img.tedomum.net/data/Tulip5-8a7fcc.png

You can use also other possible graph visualizations, you can test your 
own, but if you use all the nodes/edges most are not very readable.
For example you can use Bubble Pack to get this graph:
https://img.tedomum.net/data/Tulip6-e5392f.png

Note that the main block have the Debian spiral form :-)

Note that the high number of edges/nodes can cause slow down or block 
you computer with some algorithms (I have a very old PC with few RAM and 
I notice that a lot).

You can also make more complex analysis fetch other data, for example: 
DD names, DD nationality; upstream source (es: sourceforge, github, 
...); package tags; package dimension, ...

I don't know very well or nothing of the algorithm used to get this 
graphs, if someone of you are expert in this can extract very useful 
information with Tulip :-)

Ciao
Davide

Back to linux.debian.user | Previous | Next | Find similar | Unroll thread


Thread

if you want to see Debian (no one have seen it before! ;-) Davide Prina <davide.prina@gmail.com> - 2020-11-14 16:00 +0100

csiph-web