Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Yann E. MORIN <yann.morin.1998@free.fr>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 1/2] printvars: don't print anything when VARS is not set
Date: Tue, 12 Mar 2019 19:42:37 +0100	[thread overview]
Message-ID: <20190312184237.GF25009@scaer> (raw)
In-Reply-To: <20190312175535.18152-1-arnout@mind.be>

Arnout, All,

On 2019-03-12 18:55 +0100, Arnout Vandecappelle (Essensium/Mind) spake thusly:
> Using 'make printvars' for printing all variables is not very useful.
> E.g. all macros will output some bogus value. In addition, the same can
> be achieved with 'make -p'.
> 
> We can simply remove the condition on $(VARS). If VARS is not set, the
> filter expression will be empty which matches nothing, so nothing is
> printed.
> 
> Note that the old behaviour can still be achieved with:
> make printvars VARS=%

... with a very minor difference: now, the VARS variable is present when
it was not for a simple 'printavrs'.

I also wondered if we should not just error out now when VARS is empty
(or unset, which is the same in make), or people used to using printvars
and parsing the output, could get confused somehow. But oh well, that
case was already broken anyway...

> Update the 'make help' text to match the new behaviour.
> 
> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
> Cc: Yann E. MORIN <yann.morin.1998@free.fr>

Tested-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

Regards,
Yann E. MORIN.

> ---
>  Makefile | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index a64196f9c3..6af8923892 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1031,7 +1031,7 @@ $(BUILD_DIR)/.br2-external.in: $(BUILD_DIR)
>  printvars:
>  	@:
>  	$(foreach V, \
> -		$(sort $(if $(VARS),$(filter $(VARS),$(.VARIABLES)),$(.VARIABLES))), \
> +		$(sort $(filter $(VARS),$(.VARIABLES))), \
>  		$(if $(filter-out environment% default automatic, \
>  				$(origin $V)), \
>  		$(if $(QUOTED_VARS),\
> @@ -1124,7 +1124,7 @@ help:
>  	@echo '  source                 - download all sources needed for offline-build'
>  	@echo '  external-deps          - list external packages used'
>  	@echo '  legal-info             - generate info about license compliance'
> -	@echo '  printvars              - dump all the internal variables'
> +	@echo '  printvars              - dump internal variables selected with VARS=...'
>  	@echo
>  	@echo '  make V=0|1             - 0 => quiet build (default), 1 => verbose build'
>  	@echo '  make O=dir             - Locate all output files in "dir", including .config'
> -- 
> 2.20.1
> 

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

  parent reply	other threads:[~2019-03-12 18:42 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-12 10:57 [Buildroot] [PATCH] docs/manual: add note about spurious errors duing make printvars Martin Kepplinger
2019-03-12 12:33 ` Arnout Vandecappelle
2019-03-12 13:14   ` yann.morin at orange.com
2019-03-12 13:53     ` Arnout Vandecappelle
2019-03-12 14:04       ` yann.morin at orange.com
2019-03-12 17:36   ` Yann E. MORIN
2019-03-12 17:55     ` [Buildroot] [PATCH 1/2] printvars: don't print anything when VARS is not set Arnout Vandecappelle
2019-03-12 17:55       ` [Buildroot] [PATCH 2/2] docs/manual: document new behaviour of 'make printvars' Arnout Vandecappelle
2019-03-12 18:44         ` Yann E. MORIN
2019-03-12 18:42       ` Yann E. MORIN [this message]
2019-03-12 21:01       ` [Buildroot] [PATCH 1/2] printvars: don't print anything when VARS is not set Thomas Petazzoni

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=20190312184237.GF25009@scaer \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox