From: Yann E. MORIN <yann.morin.1998@free.fr>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 1/1] skeleton: Rename /etc/profile.d/umask to umask.sh
Date: Mon, 8 Feb 2016 18:19:40 +0100 [thread overview]
Message-ID: <20160208171940.GA3436@free.fr> (raw)
In-Reply-To: <20160208172509.2e68a8ba@free-electrons.com>
Thomas, All,
On 2016-02-08 17:25 +0100, Thomas Petazzoni spake thusly:
> On Mon, 8 Feb 2016 16:42:45 +0100, Nicolas Cavallari wrote:
> > /etc/profile only sources files that matches the /etc/profile.d/*.sh
> > pattern, so /etc/profile.d/umask was never sourced.
> >
> > Signed-off-by: Nicolas Cavallari <nicolas.cavallari@green-communications.fr>
> > ---
> > system/skeleton/etc/profile.d/{umask => umask.sh} | 0
> > 1 file changed, 0 insertions(+), 0 deletions(-)
> > rename system/skeleton/etc/profile.d/{umask => umask.sh} (100%)
> >
> > diff --git a/system/skeleton/etc/profile.d/umask b/system/skeleton/etc/profile.d/umask.sh
> > similarity index 100%
> > rename from system/skeleton/etc/profile.d/umask
> > rename to system/skeleton/etc/profile.d/umask.sh
>
> I'd rather think that /etc/profile should source all files
> in /etc/profile.d/. At least that's what I would expect from a
> <something>.d/ directory.
>
> What do others think about this?
The *.sh is customary on standard distros. So I'd keep it named as thus
so users are not surprised that we include things that would not have
been included.
The reasoning behind this is that a Bourne-compliant (aka POSIX) shell
would parse only the *.sh scripts, which ought to Bounre-compliant,
leaving aside other scripts for the other shells (like csh, which is not
Bourne-compliant but may still scan files from /etc/profile.d with a
pattern not-unlike *.csh).
Furthermore, as the (other) Thomas pointed out, we do not want to source
any stray (backup) file (even though I'd argue that the user should be
responsible for cleaning up that location before generating the image,
but that leaves local edits as a possible source of confusion).
So, I prefer that we only source /etc/profile.d/*.sh because of the
aforementioned reasons, i.e.;
- Bourne/POSIX-compliant scripts
- principple of least-surprise
Regards,
Yann E. MORIN.
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
next prev parent reply other threads:[~2016-02-08 17:19 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
2016-02-08 17:19 ` Yann E. MORIN [this message]
2016-02-09 21:47 ` [Buildroot] [PATCH 1/1] skeleton: Rename /etc/profile.d/umask to umask.sh 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=20160208171940.GA3436@free.fr \
--to=yann.morin.1998@free.fr \
--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