From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: Peter Kjellerstedt <peter.kjellerstedt@axis.com>,
openembedded-core@lists.openembedded.org
Subject: Re: [PATCHv2 3/3] base-files: profile: Simplify setting variables conditionally
Date: Wed, 05 Apr 2017 15:44:00 +0100 [thread overview]
Message-ID: <1491403440.17200.16.camel@linuxfoundation.org> (raw)
In-Reply-To: <20170405134642.12572-3-pkj@axis.com>
On Wed, 2017-04-05 at 15:46 +0200, Peter Kjellerstedt wrote:
> It is preferred to use `[ <condition> ] || ...` instead of
> `[ <negated condition> ] && ...` as the latter leaves $? set to 1.
Your patch and the description above don't match. There are changes
here which aren't <negated condition> and are stylistic changes instead
afaict. We're past feature freeze so whilst I'm interested in genuine
bugs, I do not really want code churn which just introduces risk.
Cheers,
Richard
> Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
> ---
> meta/recipes-core/base-files/base-files/profile | 14 ++++++--------
> 1 file changed, 6 insertions(+), 8 deletions(-)
>
> diff --git a/meta/recipes-core/base-files/base-files/profile
> b/meta/recipes-core/base-files/base-files/profile
> index ceaf15f799..a062028226 100644
> --- a/meta/recipes-core/base-files/base-files/profile
> +++ b/meta/recipes-core/base-files/base-files/profile
> @@ -3,15 +3,13 @@
>
> PATH="/usr/local/bin:/usr/bin:/bin"
> EDITOR="vi" # needed for packages like cron,
> git-commit
> -test -z "$TERM" && TERM="vt100" # Basic terminal capab. For
> screen etc.
> +[ "$TERM" ] || TERM="vt100" # Basic terminal capab. For
> screen etc.
>
> -if [ "$HOME" = "ROOTHOME" ]; then
> - PATH=$PATH:/usr/local/sbin:/usr/sbin:/sbin
> -fi
> -if [ "$PS1" ]; then
> - # works for bash and ash (no other shells known to be in use
> here)
> - PS1='\u@\h:\w\$ '
> -fi
> +# Add /sbin & co to $PATH for the root user
> +[ "$HOME" != "ROOTHOME" ] ||
> PATH=$PATH:/usr/local/sbin:/usr/sbin:/sbin
> +
> +# Set the prompt for bash and ash (no other shells known to be in
> use here)
> +[ -z "$PS1" ] || PS1='\u@\h:\w\$ '
>
> if [ -d /etc/profile.d ]; then
> for i in /etc/profile.d/*.sh; do
> --
> 2.12.0
>
next prev parent reply other threads:[~2017-04-05 15:08 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-05 13:46 [PATCHv2 1/3] base-files: profile: Whitespace clean up Peter Kjellerstedt
2017-04-05 13:46 ` [PATCHv2 2/3] base-files: profile: Do not assume that the tty command exists Peter Kjellerstedt
2017-04-11 14:06 ` Richard Purdie
2017-04-05 13:46 ` [PATCHv2 3/3] base-files: profile: Simplify setting variables conditionally Peter Kjellerstedt
2017-04-05 14:44 ` Richard Purdie [this message]
2017-04-06 7:21 ` Peter Kjellerstedt
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=1491403440.17200.16.camel@linuxfoundation.org \
--to=richard.purdie@linuxfoundation.org \
--cc=openembedded-core@lists.openembedded.org \
--cc=peter.kjellerstedt@axis.com \
/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.