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/1] Add TCF Agent package
Date: Thu, 30 Nov 2017 22:24:24 +0100	[thread overview]
Message-ID: <20171130212424.GA2759@scaer> (raw)
In-Reply-To: <20171130135004.54a455c9@windsurf.home>

Norbert, Thomas, All,

On 2017-11-30 13:50 +0100, Thomas Petazzoni spake thusly:
> On Thu, 30 Nov 2017 12:08:17 +0100, Norbert Lange wrote:
> > -   [ ! -r /etc/default/$DAEMON_NAME ] || . /etc/default/$DAEMON_NAME
> > This scheme is used to be able to execute that script with 'sh -e'
> > [ -r /etc/default/$DAEMON_NAME ] && . /etc/default/$DAEMON_NAME would
> > fail if there is no such file (which is no error)
> > 
> > Please tell me if I should still use the later line.
> 
> Interesting reason. Please keep your original proposal then. The
> ejabberd package is already using this construct. However, all other
> packages are using the && construct.
> 
> Unless Yann has a better suggestion for this ?

I think we should write down those rules about startup scripts and their
configuration files.

But back on topic for Norbert's use-case. I usually do like he did, but
I find it hackish nonetheless. I really prefer positive logic anyway,
like so:

    if [ -r /etc/default/foo.config ]; then
        . /etc/default/foo.config
    fi

Yes, that's three lines instead of one, but who cares, really?

However, Norbert's excuse only stands for script that are 'set -e' (i.e.
they exit as soon as a command exits with a non-zero return code.

But this is not the case of the startup script. So if we would really
want to make it a single line, then positive logic would still to be
preferred:

    [ -r /etc/default/foo.config ] && . /etc/default/foo.config

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  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:[~2017-11-30 21:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-14 14:54 [Buildroot] [PATCH 1/1] Add TCF Agent package Norbert Lange
2017-11-29 21:45 ` Thomas Petazzoni
2017-11-30 11:08   ` Norbert Lange
2017-11-30 12:50     ` Thomas Petazzoni
2017-11-30 13:53       ` Norbert Lange
2017-11-30 21:24       ` Yann E. MORIN [this message]
2017-12-01  8:40         ` Norbert Lange
2017-12-01 16:43           ` Yann E. MORIN

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=20171130212424.GA2759@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