Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 1/2] modem-manager: fix test of unset variable in init script
Date: Sat, 14 Apr 2018 18:07:25 +0200	[thread overview]
Message-ID: <20180414180725.4964d59d@windsurf> (raw)
In-Reply-To: <20180413162521.7078-2-casantos@datacom.ind.br>

Hello,

On Fri, 13 Apr 2018 13:25:20 -0300, Carlos Santos wrote:
> MODEMMANAGER_BIN was never set. Fortunately it did not break the script
> execution due to the permissive behavior of "test":
> 
>     $ test -x non-existing || echo error
>     error
>     $ test -x  || echo error
>     test -x && echo success
>     success
> 
> Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
> ---
>  package/modem-manager/S44modem-manager | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/package/modem-manager/S44modem-manager b/package/modem-manager/S44modem-manager
> index cf6d89601d..05803fe198 100755
> --- a/package/modem-manager/S44modem-manager
> +++ b/package/modem-manager/S44modem-manager
> @@ -3,6 +3,7 @@
>  # Starts ModemManager
>  #
>  
> +MODEMMANAGER_BIN=/usr/sbin/ModemManager
>  PIDFILE=/var/run/ModemManager.pid
>  
>  [ -x $MODEMMANAGER_BIN ] || exit 0

In fact, I think this test doesn't make sense. It just exits without
any error if the binary doesn't exists, which is silly.

I'm advocating for removing such tests altogether, which would make the
MODEMMANAGER_BIN variable unnecessary.

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

  reply	other threads:[~2018-04-14 16:07 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-13 16:25 [Buildroot] [PATCH 0/2] Fix/improve modem-manager init script Carlos Santos
2018-04-13 16:25 ` [Buildroot] [PATCH 1/2] modem-manager: fix test of unset variable in " Carlos Santos
2018-04-14 16:07   ` Thomas Petazzoni [this message]
2018-04-15 15:31     ` Carlos Santos
2018-04-15 18:18       ` Thomas Petazzoni
2018-04-15 18:58         ` Yann E. MORIN
2018-04-15 20:22           ` Carlos Santos
2018-04-16 15:53             ` Arnout Vandecappelle
2018-05-14  6:57               ` Thomas Petazzoni
2018-05-14 11:21                 ` Carlos Santos
2018-04-13 16:25 ` [Buildroot] [PATCH 2/2] modem-manager: support a defaults file in the " Carlos Santos

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