package/pkg-generic: add <pkg>-show-recursive-(r)depends targets
authorGeorge Redivo <george.redivo@datacom.ind.br>
Sat, 31 Mar 2018 16:35:43 +0000 (18:35 +0200)
committerPeter Korsgaard <peter@korsgaard.com>
Sun, 1 Apr 2018 20:25:57 +0000 (22:25 +0200)
This commit adds the support for <pkg>-show-recursive-depends and
<pkg>-show-recursive-rdepends which respectively show the list of all
dependencies or reverse dependencies for a given package. The existing
show-depends and show-rdepends only show the first-level dependencies,
while show-recursive-depends and show-recursive-rdepends show
recursively the dependencies.

It is worth mentioning that while show-recursive-depends really shows
all dependencies, show-recursive-rdepends is a bit limited because the
reverse dependencies of host packages are not properly accounted
for. But that's a limitation that already exists in show-rdepends, and
that cannot easily be solved.

Signed-off-by: George Redivo <george.redivo@datacom.ind.br>
[Thomas:
 - split from the patch that was also changing graph-depends
 - rename show-rrdepends to show-recursive-rdepends
 - add show-recursive-depends
 - don't create GRAPHS_DIR.]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Makefile
package/pkg-generic.mk

index 71c77f474d8c6972037e9c348053db90851614e3..0724f28f458a6c400a2829e3d9e65128b1ea6723 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1033,6 +1033,10 @@ help:
        @echo '  <pkg>-build            - Build <pkg> up to the build step'
        @echo '  <pkg>-show-depends     - List packages on which <pkg> depends'
        @echo '  <pkg>-show-rdepends    - List packages which have <pkg> as a dependency'
+       @echo '  <pkg>-show-recursive-depends'
+       @echo '                         - Recursively list packages on which <pkg> depends'
+       @echo '  <pkg>-show-recursive-rdepends'
+       @echo '                         - Recursively list packages which have <pkg> as a dependency'
        @echo '  <pkg>-graph-depends    - Generate a graph of <pkg>'\''s dependencies'
        @echo '  <pkg>-graph-rdepends   - Generate a graph of <pkg>'\''s reverse dependencies'
        @echo '  <pkg>-dirclean         - Remove <pkg> build directory'
index 84d77822d4cac81ac06bbd1b000560f773987395..25a34e6ca27c91a50ef0f0196f84935b25159777 100644 (file)
@@ -762,9 +762,17 @@ $(1)-show-version:
 $(1)-show-depends:
                        @echo $$($(2)_FINAL_ALL_DEPENDENCIES)
 
+$(1)-show-recursive-depends:
+                       @cd "$$(CONFIG_DIR)" && \
+                       $$(TOPDIR)/support/scripts/graph-depends -p $(1) -f -q
+
 $(1)-show-rdepends:
                        @echo $$($(2)_RDEPENDENCIES)
 
+$(1)-show-recursive-rdepends:
+                       @cd "$$(CONFIG_DIR)" && \
+                       $$(TOPDIR)/support/scripts/graph-depends -p $(1) --reverse -f -q
+
 $(1)-show-build-order: $$(patsubst %,%-show-build-order,$$($(2)_FINAL_ALL_DEPENDENCIES))
        $$(info $(1))