All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yann E. MORIN <yann.morin.1998@free.fr>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] pkg-infra: allow dumping reverse dependencies of a package
Date: Tue, 27 Sep 2016 23:32:49 +0200	[thread overview]
Message-ID: <20160927213249.GA8646@free.fr> (raw)
In-Reply-To: <7c4e9a67-c2f1-11fc-eeb9-9be2e391b94a@mind.be>

On 2016-09-27 22:40 +0200, Arnout Vandecappelle spake thusly:
> 
> 
> On 25-09-16 14:56, Yann E. MORIN wrote:
> > Finding the packages that select another one in a specific configuration
> > is not very trivial:
> > 
> >   - when optional, the dependency is not expressed in Kconfig
> > 
> >   - looking at the .mk files is not very nice.
> 
>  If I understand correctly, the idea is to answer the question "why is package
> foo built?", right?

Right. In my use-case, that was "what do I need to disable so I can
disable that broken package?".

>  It would make sense to also add a foo-graph-rdepends, because often you'll want
> the transitive dependencies as well and it's always nice to have it in a graph.

Yup, planned. But not trivial...

> But this patch is of course a prerequisite of that feature.

And it proved already usefull in its own right. ;-)

> > Introduce a way to dump reverse dependencies of packages, i.e. the list
> > of packages that directly depend on that package. Like for direct
> > dependencies, we limit the list to the first-order reverse dependencies.
> > 
> > Document it in the main help; use the opportunity to also docuemnt
>                                                             document

Boaf... One typo more, one typo less... I stopped countign a long time
ago! ;-)

> > foo-show-depends.
> > 
> > Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> 
> Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>

Thanks!

Regards,
Yann E. MORIN.

> > ---
> >  Makefile               | 2 ++
> >  package/pkg-generic.mk | 7 +++++++
> >  2 files changed, 9 insertions(+)
> > 
> > diff --git a/Makefile b/Makefile
> > index 5e4daef..3039983 100644
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -943,6 +943,8 @@ help:
> >  	@echo '  <pkg>-depends          - Build <pkg>'\''s dependencies'
> >  	@echo '  <pkg>-configure        - Build <pkg> up to the configure step'
> >  	@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>-graph-depends    - Generate a graph of <pkg>'\''s dependencies'
> >  	@echo '  <pkg>-dirclean         - Remove <pkg> build directory'
> >  	@echo '  <pkg>-reconfigure      - Restart the build from the configure step'
> > diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
> > index 68ead3d..779f294 100644
> > --- a/package/pkg-generic.mk
> > +++ b/package/pkg-generic.mk
> > @@ -523,6 +523,10 @@ $(2)_FINAL_DEPENDENCIES = $$(sort $$($(2)_DEPENDENCIES))
> >  $(2)_FINAL_PATCH_DEPENDENCIES = $$(sort $$($(2)_PATCH_DEPENDENCIES))
> >  $(2)_FINAL_ALL_DEPENDENCIES = $$(sort $$($(2)_FINAL_DEPENDENCIES) $$($(2)_FINAL_PATCH_DEPENDENCIES))
> >  
> > +# Register package as a reverse-dependencies of all its dependencies
> > +$$(eval $$(foreach p,$$($(2)_FINAL_ALL_DEPENDENCIES),\
> > +	$$(call UPPERCASE,$$(p))_RDEPENDENCIES += $(1)$$(sep)))
> > +
> >  $(2)_INSTALL_STAGING		?= NO
> >  $(2)_INSTALL_IMAGES		?= NO
> >  $(2)_INSTALL_TARGET		?= YES
> > @@ -698,6 +702,9 @@ $(1)-show-version:
> >  $(1)-show-depends:
> >  			@echo $$($(2)_FINAL_ALL_DEPENDENCIES)
> >  
> > +$(1)-show-rdepends:
> > +			@echo $$($(2)_RDEPENDENCIES)
> > +
> >  $(1)-graph-depends: graph-depends-requirements
> >  			@$$(INSTALL) -d $$(GRAPHS_DIR)
> >  			@cd "$$(CONFIG_DIR)"; \
> > 
> 
> -- 
> Arnout Vandecappelle                          arnout at mind be
> Senior Embedded Software Architect            +32-16-286500
> Essensium/Mind                                http://www.mind.be
> G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
> LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
> GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

  reply	other threads:[~2016-09-27 21:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-25 12:56 [Buildroot] [PATCH] pkg-infra: allow dumping reverse dependencies of a package Yann E. MORIN
2016-09-27 20:40 ` Arnout Vandecappelle
2016-09-27 21:32   ` Yann E. MORIN [this message]
2016-09-27 22:02     ` Arnout Vandecappelle
2016-09-27 22:10       ` Yann E. MORIN
2016-09-27 22:18         ` Arnout Vandecappelle
2016-10-23 13:23 ` Thomas Petazzoni
2016-10-23 15:08   ` Yann E. MORIN

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160927213249.GA8646@free.fr \
    --to=yann.morin.1998@free.fr \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.