*ping*

//Peter

> -----Original Message-----
> From: openembedded-core-boun...@lists.openembedded.org
> [mailto:openembedded-core-boun...@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.kjellerst...@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
-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Reply via email to