From: Denys Dmytriyenko <denys@ti.com>
To: Hongmei Gou <h-gou@ti.com>
Cc: meta-arago@arago-project.org
Subject: Re: [PATCH] matrix-gui: update init scripts to execute /etc/profile.d/*.sh only when they exist
Date: Fri, 18 Aug 2017 15:53:04 -0400 [thread overview]
Message-ID: <20170818195304.GC28233@edge> (raw)
In-Reply-To: <1503085785-9443-1-git-send-email-h-gou@ti.com>
On Fri, Aug 18, 2017 at 03:49:45PM -0400, Hongmei Gou wrote:
> Signed-off-by: Hongmei Gou <h-gou@ti.com>
> ---
> meta-arago-extras/recipes-core/matrix/matrix-gui/init | 16 ++++++++++------
> .../recipes-core/matrix/matrix-gui/init.eglfs | 14 +++++++++-----
> meta-arago-extras/recipes-core/matrix/matrix-gui_2.0.bb | 2 +-
> 3 files changed, 20 insertions(+), 12 deletions(-)
>
> diff --git a/meta-arago-extras/recipes-core/matrix/matrix-gui/init b/meta-arago-extras/recipes-core/matrix/matrix-gui/init
> index 3ec0a55..4a002d1 100644
> --- a/meta-arago-extras/recipes-core/matrix/matrix-gui/init
> +++ b/meta-arago-extras/recipes-core/matrix/matrix-gui/init
> @@ -5,12 +5,16 @@ GUI_OPTS="http://localhost:80/ __MATRIX_FLAGS__"
> PIDFILE="/var/run/matrix-gui-2.0.pid"
>
> # Important System Environment Variables
> -SCRIPTS=/etc/profile.d/*.sh
> -
> -for f in $SCRIPTS
> -do
> - source $f
> -done
> +DIR=/etc/profile.d
> +SCRIPTS=$DIR/*.sh
> +
> +if [ "$(ls -A $DIR)" ];
> +then
> + for f in $SCRIPTS
> + do
> + source $f
> + done
> +fi
Why not simply this:
for sh in /etc/profile.d/*.sh ; do
[ -r "$sh" ] && . "$sh"
done
That's what other distros are doing and it works fine.
> test -x "$matrixgui" || exit 0
>
> diff --git a/meta-arago-extras/recipes-core/matrix/matrix-gui/init.eglfs b/meta-arago-extras/recipes-core/matrix/matrix-gui/init.eglfs
> index 213f859..bc93cd3 100644
> --- a/meta-arago-extras/recipes-core/matrix/matrix-gui/init.eglfs
> +++ b/meta-arago-extras/recipes-core/matrix/matrix-gui/init.eglfs
> @@ -5,12 +5,16 @@ GUI_OPTS="http://localhost:80/ __MATRIX_FLAGS__"
> PIDFILE="/var/run/matrix-gui-2.0.pid"
>
> # Important System Environment Variables
> -SCRIPTS=/etc/profile.d/*.sh
> +DIR=/etc/profile.d
> +SCRIPTS=$DIR/*.sh
>
> -for f in $SCRIPTS
> -do
> - source $f
> -done
> +if [ "$(ls -A $DIR)" ];
> +then
> + for f in $SCRIPTS
> + do
> + source $f
> + done
> +fi
>
> test -x "$matrixgui" || exit 0
>
> diff --git a/meta-arago-extras/recipes-core/matrix/matrix-gui_2.0.bb b/meta-arago-extras/recipes-core/matrix/matrix-gui_2.0.bb
> index aecc3be..507a98c 100644
> --- a/meta-arago-extras/recipes-core/matrix/matrix-gui_2.0.bb
> +++ b/meta-arago-extras/recipes-core/matrix/matrix-gui_2.0.bb
> @@ -6,7 +6,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=a886c9ef769b2d8271115d2502512e5d"
>
> SECTION = "multimedia"
>
> -PR = "r31"
> +PR = "r32"
>
> INITSCRIPT_NAME = "matrix-gui-2.0"
> INITSCRIPT_PARAMS = "defaults 97"
> --
> 1.9.1
>
> _______________________________________________
> meta-arago mailing list
> meta-arago@arago-project.org
> http://arago-project.org/cgi-bin/mailman/listinfo/meta-arago
prev parent reply other threads:[~2017-08-18 19:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-18 19:49 [PATCH] matrix-gui: update init scripts to execute /etc/profile.d/*.sh only when they exist Hongmei Gou
2017-08-18 19:53 ` Denys Dmytriyenko [this message]
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=20170818195304.GC28233@edge \
--to=denys@ti.com \
--cc=h-gou@ti.com \
--cc=meta-arago@arago-project.org \
/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.