From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 1/2] support/script/pkg-stats: run the 3 `make` calls in parallel
Date: Thu, 11 Jul 2019 15:08:32 +0200 [thread overview]
Message-ID: <20190711150832.136f7a4e@windsurf> (raw)
In-Reply-To: <20190711095448.7417-1-victor.huesca@bootlin.com>
Hello Victor,
On Thu, 11 Jul 2019 11:54:47 +0200
Victor Huesca <victor.huesca@bootlin.com> wrote:
> +def check_multiple_output(cmds, *popenargs, **kwargs):
> + '''
> + Run each `cmd` asynchronousely and return their respective output.
> + The execution time is the max of all subprocess execution time.
> + '''
> + processes = [subprocess.Popen(cmd, *popenargs,
> + stdout=subprocess.PIPE,
> + stderr=subprocess.PIPE,
> + **kwargs) for cmd in cmds]
> + for proc in processes:
> + out, err = proc.communicate()
> + yield out
> +
> +
> def package_init_make_info():
> + # Fetch all variables at once
> + licenses, files, versions = check_multiple_output([
> + ["make", "BR2_HAVE_DOT_CONFIG=y", "-s", "printvars", "VARS=%_LICENSE"],
> + ["make", "BR2_HAVE_DOT_CONFIG=y", "-s", "printvars", "VARS=%_LICENSE_FILES"],
> + ["make", "BR2_HAVE_DOT_CONFIG=y", "-s", "printvars", "VARS=%_VERSION"],
Instead of doing this, what about running:
make printvars VARS="%_LICENSE %_LICENSE_FILES %_VERSION"
and then parse out the result, which will contain all the _LICENSE,
_LICENSE_FILES and _VERSION variables ?
Best regards,
Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
next prev parent reply other threads:[~2019-07-11 13:08 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-11 9:54 [Buildroot] [PATCH 1/2] support/script/pkg-stats: run the 3 `make` calls in parallel Victor Huesca
2019-07-11 9:54 ` [Buildroot] [PATCH 2/2] support/script/pkg-stats: run 'get latest version' in a process-pool Victor Huesca
2019-07-11 13:37 ` Arnout Vandecappelle
2019-07-11 13:08 ` Thomas Petazzoni [this message]
2019-07-11 13:17 ` [Buildroot] [PATCH 1/2] support/script/pkg-stats: run the 3 `make` calls in parallel Victor Huesca
2019-07-11 13:18 ` Arnout Vandecappelle
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=20190711150832.136f7a4e@windsurf \
--to=thomas.petazzoni@bootlin.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 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.