From: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
To: Peter Kjellerstedt <pkj@axis.com>,
"openembedded-core@lists.openembedded.org"
<openembedded-core@lists.openembedded.org>
Subject: Re: [PATCHv2 1/1] base-files: profile: Avoid using "command" to determine if programs exist
Date: Mon, 19 Jun 2017 14:53:07 +0000 [thread overview]
Message-ID: <106084978a804bf8a2b3aa10195bfa9f@XBOX02.axis.com> (raw)
In-Reply-To: <0991deba9e90e3c32f8566fdfc758cb88790bde4.1492086566.git.pkj@axis.com>
*ping*
//Peter
> -----Original Message-----
> From: openembedded-core-bounces@lists.openembedded.org
> [mailto:openembedded-core-bounces@lists.openembedded.org] On Behalf Of
> Peter Kjellerstedt
> Sent: den 13 april 2017 14:30
> To: openembedded-core@lists.openembedded.org
> Subject: [OE-core] [PATCHv2 1/1] base-files: profile: Avoid using
> "command" to determine if programs exist
>
> Since the existence of "command" in itself is not guaranteed, using it
> to determine if other executables exist is moot. Instead just run the
> executables and let the shell determine if they exist. By piping stderr
> to /dev/null we avoid unnecessary warnings in case they do not exist.
>
> 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..e05c8840db 100644
> --- a/meta/recipes-core/base-files/base-files/profile
> +++ b/meta/recipes-core/base-files/base-files/profile
> @@ -22,14 +22,12 @@ if [ -d /etc/profile.d ]; then
> unset i
> fi
>
> -if command -v resize >/dev/null && command -v tty >/dev/null; then
> - # Make sure we are on a serial console (i.e. the device used
> starts with
> - # /dev/tty[A-z]), otherwise we confuse e.g. the eclipse
> launcher which
> - # tries do use ssh
> - case $(tty) in
> - /dev/tty[A-z]*) resize >/dev/null;;
> - esac
> -fi
> +# Make sure we are on a serial console (i.e. the device used starts
> with
> +# /dev/tty[A-z]), otherwise we confuse e.g. the eclipse launcher which
> tries do
> +# use ssh
> +case $(tty 2>/dev/null) in
> + /dev/tty[A-z]*) resize >/dev/null 2>&1;;
> +esac
>
> export PATH PS1 OPIEDIR QPEDIR QTDIR EDITOR TERM
>
> --
> 2.12.0
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
next prev parent reply other threads:[~2017-06-19 14:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-13 12:30 [PATCHv2 0/1] Do not use command in profile Peter Kjellerstedt
2017-04-13 12:30 ` [PATCHv2 1/1] base-files: profile: Avoid using "command" to determine if programs exist Peter Kjellerstedt
2017-06-19 14:53 ` Peter Kjellerstedt [this message]
2017-09-15 14:06 ` Peter Kjellerstedt
2017-04-21 7:48 ` [PATCHv2 0/1] Do not use command in profile Johannes Pointner
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=106084978a804bf8a2b3aa10195bfa9f@XBOX02.axis.com \
--to=peter.kjellerstedt@axis.com \
--cc=openembedded-core@lists.openembedded.org \
--cc=pkj@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox