support/graph-depends: make sure mandatory deps are displayed
authorThomas Petazzoni <thomas.petazzoni@bootlin.com>
Sun, 3 Mar 2019 10:16:29 +0000 (11:16 +0100)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Sun, 17 Mar 2019 13:34:02 +0000 (14:34 +0100)
commit1e414fbe9b9193da566d2af71537a14e9fcae869
treec2d5b424e5b19aa9db8986ac09a584784aaa3cd1
parenta54194f35c5c65d1e73491f9f75aaaee905e3d15
support/graph-depends: make sure mandatory deps are displayed

The current graph-depends implementation filters out a number of
"mandatory" dependencies that all packages have: dependency on
"toolchain" and dependency on "skeleton".

Despite this filtering, in full graph dependencies, "toolchain" and
"skeleton" are still shown, because they are target packages, and
therefore appear in the result of "make show-targets". Thanks to this,
they will be visible as dependencies of the "ALL" node, which is the
root of the dependency tree.

However, as we are going to introduce host-skeleton as a "mandatory
dependency" to be filtered out, this is no longer going to work.

This commit adjusts the remove_extra_deps() function to ensure that
when a mandatory dependency is removed, this dependency exists between
the root of the dependency tree and the mandatory dependency.

This issue was noticed by Yann E. Morin, and this commit provides a
different implementation than what Yann proposed in
https://patchwork.ozlabs.org/patch/910453/.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
[yann.morin.1998@free.fr:
  - list mandatory deps before removing them
  - fix flake8 warnings
]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
support/scripts/graph-depends