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 1/2] Avoid misleading error output caused by missing shell quotes
Date: Tue, 18 Nov 2014 23:36:54 +0100	[thread overview]
Message-ID: <20141118223653.GS4333@free.fr> (raw)
In-Reply-To: <1415799105-27566-1-git-send-email-debian@jstimpfle.de>

Jens, All,

On 2014-11-12 13:31 +0000, Jens Stimpfle spake thusly:
> Signed-off-by: Jens Stimpfle <debian@jstimpfle.de>
> ---
> 
> Notes:
>     When g++ is not installed, a misleading error message turns up because
>     of a bad combination of an unquoted shell variable and control flow.
>     
>     > ~/buildroot$ make
>     >
>     > You may have to install 'g++' on your build machine
>     > /home/testuser/buildroot/support/dependencies/dependencies.sh: 136: [: -lt: unexpected operator

This should have been part of the commit log, above your Signed-off-by
line.

Whatever is after the --- line is ignored by git when a patch is
applied, but the information you provide is interesting and we want to
keep it in the logs.

What about changing your commit log to:

    support: avoid spurious error output when checking dependencies

    When g++ is not installed, a misleading error message turns up because
    of a bad combination of an unquoted shell variable and control flow.

        $ ~/buildroot$ make
        You may have to install 'g++' on your build machine
        /home/testuser/buildroot/support/dependencies/dependencies.sh: 136: [: -lt: unexpected operator

    Signed-off-by: You

Otherwise, the change looks sane, but see below...

>     This is a nonintrusive workaround.
> 
>  support/dependencies/dependencies.sh | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/support/dependencies/dependencies.sh b/support/dependencies/dependencies.sh
> index a9c5b31..4b8991d 100755
> --- a/support/dependencies/dependencies.sh
> +++ b/support/dependencies/dependencies.sh
> @@ -118,7 +118,6 @@ CXXCOMPILER=$(which $HOSTCXX_NOCCACHE 2> /dev/null)
>  if [ -z "$CXXCOMPILER" ] ; then
>  	CXXCOMPILER=$(which c++ 2> /dev/null)
>  fi
> -

Spurious empty line removal. Please keep it.

>  if [ -z "$CXXCOMPILER" ] ; then
>  	echo
>  	echo "You may have to install 'g++' on your build machine"
> @@ -130,7 +129,8 @@ if [ ! -z "$CXXCOMPILER" ] ; then
>  		echo
>  		echo "You may have to install 'g++' on your build machine"
>  	fi
> -
> +fi
> +if [ ! -z "$CXXCOMPILER_VERSION" ] ; then

I'd like it if there was an empty line after the 'fi' and before the
'if'.

Also, we prefer positive logic:

    if [ -n "$CXXCOMPILER_VERSION" ] ; then

Regards,
Yann E. MORIN.

>  	CXXCOMPILER_MAJOR=$(echo $CXXCOMPILER_VERSION | sed -e "s/\..*//g")
>  	CXXCOMPILER_MINOR=$(echo $CXXCOMPILER_VERSION | sed -e "s/^$CXXCOMPILER_MAJOR\.//g" -e "s/\..*//g")
>  	if [ $CXXCOMPILER_MAJOR -lt 3 -o $CXXCOMPILER_MAJOR -eq 2 -a $CXXCOMPILER_MINOR -lt 95 ] ; then
> -- 
> 2.1.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'

  parent reply	other threads:[~2014-11-18 22:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-12 13:31 [Buildroot] [PATCH 1/2] Avoid misleading error output caused by missing shell quotes Jens Stimpfle
2014-11-12 13:31 ` [Buildroot] [PATCH 2/2] Unclutter standard error output while feature testing for 32 bit gcc Jens Stimpfle
2014-11-18 22:38   ` Yann E. MORIN
2014-11-18 22:36 ` Yann E. MORIN [this message]
2014-12-08 21:33 ` [Buildroot] [PATCH 1/2] Avoid misleading error output caused by missing shell quotes 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=20141118223653.GS4333@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.