Skip to content

Add new graph command to create dependency graphs

Pablo Marcos Oltra requested to merge pamarcos/cerbero:deps_graph into master

This option uses dot CLI from graphviz to generate a nice SVG containing the full tree of dependencies for a given recipe or package. dot needs to be available. So, graphviz package needs to be installed for this functionality to be used. I thought about adding it to the bootstrapping phase, but it's a package with lots of dependencies and not everybody will use this command anyways.

First approach was to include a --graph option into the already existing deps command. It is now a new and separate command. It can show the all dependencies of either a recipe or a package. In case it's a package, all packages it depends on will be used when using --package. If --package-recipes is given, all the recipes of all the packages it depends upon will be considered.

./cerbero-uninstalled graph --help       
usage: cerbero-uninstalled graph [-h] [-r] [-p] [-pr] [-o OUTPUT] name

positional arguments:
  name                  name of the recipe or package to generate deps from

optional arguments:
  -h, --help            show this help message and exit
  -r, --recipe          generate deps for the given recipe
  -p, --package         generate deps for the given package
  -pr, --package-recipes
                        generate recipe deps for the given package
  -o OUTPUT, --output OUTPUT
                        output file for the SVG graph

./cerbero-uninstalled graph gstreamer-1.0 -r -o gstreamer-1.0-recipe.svg gstreamer-1.0-recipe.svg

./cerbero-uninstalled graph gstreamer-1.0 -p -o gstreamer-1.0-package.svg gstreamer-1.0-package.svg

./cerbero-uninstalled graph gstreamer-1.0 -pr -o gstreamer-1.0-package-recipes.svg gstreamer-1.0-package-recipes.svg

Edited by Pablo Marcos Oltra

Merge request reports