[1/7,v2] support/graph-depends: ensure all packages get graphed

Message ID 48649e34b8cfb9fffac892da495452a4c519decb.1525812011.git.yann.morin.1998@free.fr
State Changes Requested
Headers show
Series
  • [1/7,v2] support/graph-depends: ensure all packages get graphed
Related show

Commit Message

Yann E. MORIN May 8, 2018, 8:40 p.m.
When a package:
  - has no dependency,
  - is not a first-level target,
  - is a cut-off point,

then this package is omitted from the dependency graph.

We currently have no such package, but the next commit will make
host-skeleton, which already matches the first two conditions, a cut-off
point too, and thus host-skeleton would not appear on the graph.

To ensure that all packages, whatever their conditions, are displayed,
we add them as a dependency of 'all'.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
 support/scripts/graph-depends | 9 +++++++++
 1 file changed, 9 insertions(+)

Patch

diff --git a/support/scripts/graph-depends b/support/scripts/graph-depends
index 621e603278..6ce90d872c 100755
--- a/support/scripts/graph-depends
+++ b/support/scripts/graph-depends
@@ -391,6 +391,15 @@  def main():
         deps = get_all_depends(filtered_targets, get_depends_func)
         if deps is not None:
             dependencies += deps
+            # 'all' depends on everything, so add any newly discovered
+            # package. d[0] was a target, above, or a d[1] of another
+            # tuple, so it's already in the list.
+            for d in deps:
+                if d[1] in TARGET_EXCEPTIONS:
+                    continue
+                if ('all', d[1]) in dependencies:
+                    continue
+                dependencies.append(('all', d[1]))
         rootpkg = 'all'
 
     # In pkg mode, start directly with get_all_depends() on the requested