summaryrefslogtreecommitdiff
path: root/nonsystemd/filesystem/profile
diff options
context:
space:
mode:
authorbill-auger <mr.j.spam.me@gmail.com>2020-09-27 21:37:50 -0400
committerbill-auger <mr.j.spam.me@gmail.com>2020-09-27 23:08:52 -0400
commita0819b82d83c8d4b2c32035c538ef7ca127eeb19 (patch)
tree772acf9c504f885668c33040a9cb90923819c486 /nonsystemd/filesystem/profile
parentd1f10cc5ba8e163f35eec9e22338cb27a0bb0313 (diff)
downloadabslibre-a0819b82d83c8d4b2c32035c538ef7ca127eeb19.tar.gz
abslibre-a0819b82d83c8d4b2c32035c538ef7ca127eeb19.tar.bz2
abslibre-a0819b82d83c8d4b2c32035c538ef7ca127eeb19.zip
[nonsystemd/filesystem]: upgrade to v2020.09.03
only the changes to profile and shadow are significant the rest are trivial housekeeping, to minimize the diffs across the arch and libre PKGBUILDs
Diffstat (limited to 'nonsystemd/filesystem/profile')
-rw-r--r--nonsystemd/filesystem/profile26
1 files changed, 18 insertions, 8 deletions
diff --git a/nonsystemd/filesystem/profile b/nonsystemd/filesystem/profile
index a4f717734..ef3f9f68c 100644
--- a/nonsystemd/filesystem/profile
+++ b/nonsystemd/filesystem/profile
@@ -3,8 +3,9 @@
# Set our umask
umask 022
-# Append our default paths
-appendpath () {
+# Append "$1" to $PATH when not already in.
+# This function API is accessible to scripts in /etc/profile.d
+append_path () {
case ":$PATH:" in
*:"$1":*)
;;
@@ -13,11 +14,12 @@ appendpath () {
esac
}
-appendpath '/usr/local/sbin'
-appendpath '/usr/local/bin'
-appendpath '/usr/bin'
-unset appendpath
+# Append our default paths
+append_path '/usr/local/sbin'
+append_path '/usr/local/bin'
+append_path '/usr/bin'
+# Force PATH to be environment
export PATH
# Load profiles from /etc/profile.d
@@ -28,8 +30,16 @@ if test -d /etc/profile.d/; then
unset profile
fi
-# Source global bash config
-if test "$PS1" && test "$BASH" && test -z ${POSIXLY_CORRECT+x} && test -r /etc/bash.bashrc; then
+# Unload our profile API functions
+unset -f append_path
+
+# Source global bash config, when interactive but not posix or sh mode
+if test "$BASH" &&\
+ test "$PS1" &&\
+ test -z "$POSIXLY_CORRECT" &&\
+ test "${0#-}" != sh &&\
+ test -r /etc/bash.bashrc
+then
. /etc/bash.bashrc
fi