* [Buildroot] [PATCH] /etc/profile: read in /etc/profile.d/*.sh files
@ 2011-10-19 7:36 Thomas De Schampheleire
2011-10-28 9:41 ` Thomas De Schampheleire
2011-10-28 12:59 ` Peter Korsgaard
0 siblings, 2 replies; 3+ messages in thread
From: Thomas De Schampheleire @ 2011-10-19 7:36 UTC (permalink / raw)
To: buildroot
For custom projects, it is more maintainable to add custom profile settings in a
separate file, than directly in /etc/profile.
This patch modifies /etc/profile to read in *.sh files from /etc/profile.d/, a
technique commonly used in Linux distributions.
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
---
fs/skeleton/etc/profile | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/fs/skeleton/etc/profile b/fs/skeleton/etc/profile
--- a/fs/skeleton/etc/profile
+++ b/fs/skeleton/etc/profile
@@ -46,3 +46,10 @@ if [ "$PS1" ]; then
alias calc='calc -Cd '
alias bc='calc -Cd '
fi;
+
+# Source configuration files from /etc/profile.d
+for i in /etc/profile.d/*.sh ; do
+ if [ -r "$i" ]; then
+ . $i
+ fi
+done
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Buildroot] [PATCH] /etc/profile: read in /etc/profile.d/*.sh files
2011-10-19 7:36 [Buildroot] [PATCH] /etc/profile: read in /etc/profile.d/*.sh files Thomas De Schampheleire
@ 2011-10-28 9:41 ` Thomas De Schampheleire
2011-10-28 12:59 ` Peter Korsgaard
1 sibling, 0 replies; 3+ messages in thread
From: Thomas De Schampheleire @ 2011-10-28 9:41 UTC (permalink / raw)
To: buildroot
On Wed, Oct 19, 2011 at 9:36 AM, Thomas De Schampheleire
<patrickdepinguin+buildroot@gmail.com> wrote:
> For custom projects, it is more maintainable to add custom profile settings in a
> separate file, than directly in /etc/profile.
>
> This patch modifies /etc/profile to read in *.sh files from /etc/profile.d/, a
> technique commonly used in Linux distributions.
>
> Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
>
> ---
> ?fs/skeleton/etc/profile | ?7 +++++++
> ?1 files changed, 7 insertions(+), 0 deletions(-)
>
> diff --git a/fs/skeleton/etc/profile b/fs/skeleton/etc/profile
> --- a/fs/skeleton/etc/profile
> +++ b/fs/skeleton/etc/profile
> @@ -46,3 +46,10 @@ if [ "$PS1" ]; then
> ? ? alias calc='calc -Cd '
> ? ? alias bc='calc -Cd '
> ?fi;
> +
> +# Source configuration files from /etc/profile.d
> +for i in /etc/profile.d/*.sh ; do
> + ? ?if [ -r "$i" ]; then
> + ? ? ? ?. $i
> + ? ?fi
> +done
>
>
>
bump
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Buildroot] [PATCH] /etc/profile: read in /etc/profile.d/*.sh files
2011-10-19 7:36 [Buildroot] [PATCH] /etc/profile: read in /etc/profile.d/*.sh files Thomas De Schampheleire
2011-10-28 9:41 ` Thomas De Schampheleire
@ 2011-10-28 12:59 ` Peter Korsgaard
1 sibling, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2011-10-28 12:59 UTC (permalink / raw)
To: buildroot
>>>>> "Thomas" == Thomas De Schampheleire <patrickdepinguin+buildroot@gmail.com> writes:
Thomas> For custom projects, it is more maintainable to add custom
Thomas> profile settings in a separate file, than directly in
Thomas> /etc/profile.
Committed, thanks.
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-10-28 12:59 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-19 7:36 [Buildroot] [PATCH] /etc/profile: read in /etc/profile.d/*.sh files Thomas De Schampheleire
2011-10-28 9:41 ` Thomas De Schampheleire
2011-10-28 12:59 ` Peter Korsgaard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox