From: Arnout Vandecappelle <arnout@mind.be>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH RESEND 1/1] skeleton: Have /etc/profile source [A-Za-z0-9_-]+ files in profile.d.
Date: Tue, 9 Feb 2016 22:46:32 +0100 [thread overview]
Message-ID: <56BA5E38.5010806@mind.be> (raw)
In-Reply-To: <1455030388-10858-1-git-send-email-nicolas.cavallari@green-communications.fr>
On 09-02-16 16:06, Nicolas Cavallari wrote:
> Instead of sourcing all files ending with .sh (which is unexpected
> enough that /etc/profile.d/umask was missed), source all files which
> matches [A-Za-z0-9_-]+. This way, backup files from most text editors
> (e.g. umask~, umask.dpkg-old, .umask.swp~) will not be sourced.
Actually, I'm with Yann, it's better to keep it as *.sh. In addition to the
reasons he quotes, I'd also add that the code with this patch becomes a lot more
complicated than just sourcing *.sh.
Regards,
Arnout
>
> Signed-off-by: Nicolas Cavallari <nicolas.cavallari@green-communications.fr>
> ---
>
> Resend with the correct list address.
>
> diff --git a/system/skeleton/etc/profile b/system/skeleton/etc/profile
> index 3a97427..2fb7743 100644
> --- a/system/skeleton/etc/profile
> +++ b/system/skeleton/etc/profile
> @@ -12,9 +12,14 @@ export PAGER='/bin/more '
> export EDITOR='/bin/vi'
>
> # Source configuration files from /etc/profile.d
> -for i in /etc/profile.d/*.sh ; do
> - if [ -r "$i" ]; then
> - . $i
> - fi
> - unset i
> +for i in /etc/profile.d/* ; do
> + case "$i" in
> + /etc/profile.d/*[^A-Za-z0-9_-]*)
> + continue;;
> + *)
> + if [ -r "$i" ]; then
> + . $i
> + fi
> + esac
> done
> +unset i
>
--
Arnout Vandecappelle arnout at mind be
Senior Embedded Software Architect +32-16-286500
Essensium/Mind http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
next prev parent reply other threads:[~2016-02-09 21:46 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-08 15:42 [Buildroot] [PATCH 1/1] skeleton: Rename /etc/profile.d/umask to umask.sh Nicolas Cavallari
2016-02-08 16:25 ` Thomas Petazzoni
2016-02-08 16:45 ` Thomas Claveirole
2016-02-08 16:57 ` Thomas Petazzoni
2016-02-08 17:14 ` Thomas Claveirole
2016-02-09 15:06 ` [Buildroot] [PATCH RESEND 1/1] skeleton: Have /etc/profile source [A-Za-z0-9_-]+ files in profile.d Nicolas Cavallari
2016-02-09 21:46 ` Arnout Vandecappelle [this message]
2016-02-08 17:19 ` [Buildroot] [PATCH 1/1] skeleton: Rename /etc/profile.d/umask to umask.sh Yann E. MORIN
2016-02-09 21:47 ` Arnout Vandecappelle
2016-02-10 6:49 ` Peter Korsgaard
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=56BA5E38.5010806@mind.be \
--to=arnout@mind.be \
--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