Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 1/2] graph-depends: display virtual package with italic style
Date: Fri, 2 Jan 2015 12:37:42 +0100	[thread overview]
Message-ID: <20150102123742.6e00c2b0@free-electrons.com> (raw)
In-Reply-To: <1420188573-4236-1-git-send-email-francois.perrad@gadz.org>

Dear Francois Perrad,

On Fri,  2 Jan 2015 09:49:32 +0100, Francois Perrad wrote:
> virtual packages are found by their version,
> so we retrieve the version of all packages
> 
> Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
> ---
>  package/pkg-generic.mk        |  3 +++
>  support/scripts/graph-depends | 34 +++++++++++++++++++++++++++++++++-
>  2 files changed, 36 insertions(+), 1 deletion(-)
> 
> diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
> index 9643a30..87d8dd8 100644
> --- a/package/pkg-generic.mk
> +++ b/package/pkg-generic.mk
> @@ -565,6 +565,9 @@ $(1)-rsync:		$$($(2)_TARGET_RSYNC)
>  $(1)-source:		$$($(2)_TARGET_RSYNC_SOURCE)
>  endif
>  
> +$(1)-show-version:
> +			@echo $$($(2)_VERSION)
> +

This could be a separate patch, maybe?

> +# Execute the "make <pkg>-show-version" command to get the version of a given
> +# list of packages, and return the version formatted as a Python dictionary.
> +def get_version(pkgs):
> +    sys.stderr.write("Getting version for %s\n" % pkgs)
> +    cmd = ["make", "-s", "--no-print-directory" ]
> +    for pkg in pkgs:
> +        cmd.append("%s-show-version" % pkg)

Good, I like the fact that we're doing only one make invocation.

> +all_pkgs = {}
> +for deps in dict_deps.values():
> +    for dep in deps:
> +        all_pkgs[dep] = True
> +for dep in dict_deps.keys():
> +    all_pkgs[dep] = True
> +dict_version = get_version(all_pkgs.keys())

I'm not sure what is going on here. Why aren't you using the existing
'allpkgs' list? It contains the list of all packages, you would just
have to filter the fake 'all' entry in your "for pkg in pkgs:" loop in
the get_version() function.

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

  parent reply	other threads:[~2015-01-02 11:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-02  8:49 [Buildroot] [PATCH 1/2] graph-depends: display virtual package with italic style Francois Perrad
2015-01-02  8:49 ` [Buildroot] [PATCH 2/2] graph-depends: add an option --stop-on-virtual Francois Perrad
2015-01-02 10:21   ` Thomas Petazzoni
2015-01-03 13:49     ` François Perrad
2015-01-02 11:37 ` Thomas Petazzoni [this message]
2015-01-03 13:25   ` [Buildroot] [PATCH 1/2] graph-depends: display virtual package with italic style François Perrad

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=20150102123742.6e00c2b0@free-electrons.com \
    --to=thomas.petazzoni@free-electrons.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox