From be012e21222c4d8d70082d12353acb163dc60ba8 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Wed, 4 Dec 2013 23:20:35 +0100 Subject: [PATCH] /etc/profile: Also source profile.d/*.sh files in data dirs This allows packages to place files in data/profile.d to manipulate the shell environment. They could already use settings/etc/profile.d, but since there's no point in editing those files in most cases, placing them there nonetheless doesn't make much sense. --- data/etc/profile | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/data/etc/profile b/data/etc/profile index e61bbc89fa..97650285a5 100644 --- a/data/etc/profile +++ b/data/etc/profile @@ -106,6 +106,16 @@ function dir { ls -lF "$@"; } +for dir in `findpaths -Re B_FIND_PATH_DATA_DIRECTORY profile.d 2> /dev/null`; do + for i in $dir/*.sh; do + if [ -r $i ]; then + . $i + fi + done + unset i +done +unset dir + if [ -d /etc/profile.d ]; then for i in /etc/profile.d/*.sh; do if [ -r $i ]; then