git://git.iain.cx/iain
/
profile.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Handle the case where $HOME has a trailing slash.
[profile.git]
/
.bash_profile
diff --git
a/.bash_profile
b/.bash_profile
index
3d5d075
..
5170519
100644
(file)
--- a/
.bash_profile
+++ b/
.bash_profile
@@
-3,8
+3,10
@@
if [ -t 0 -o "${0:0:1}" = "-" -o "$1" = "force" ]; then
if [ -z "$PROFILE_HOME" ]; then
# BASH_SOURCE isn't available prior to bash 3.
profile_home=${BASH_SOURCE%/*}
if [ -z "$PROFILE_HOME" ]; then
# BASH_SOURCE isn't available prior to bash 3.
profile_home=${BASH_SOURCE%/*}
+ [ -n "$profile_home" -a -d "$profile_home" -a ! "${profile_home:0:1}" = "/" ] && profile_home=$(readlink -f "$profile_home" 2>/dev/null)
[ "$profile_home" = "$BASH_SOURCE" ] && profile_home=$PWD
[ "$profile_home" = "$HOME" ] || PROFILE_HOME=$profile_home
[ "$profile_home" = "$BASH_SOURCE" ] && profile_home=$PWD
[ "$profile_home" = "$HOME" ] || PROFILE_HOME=$profile_home
+ PROFILE_RC="$profile_home/.bash_profile"
unset profile_home
fi
unset profile_home
fi
@@
-34,12
+36,12
@@
BECOME.bashrc"
PATH=/usr/bin:/bin:/usr/ccs/bin
# Sort all scripts by dependencies.
PATH=/usr/bin:/bin:/usr/ccs/bin
# Sort all scripts by dependencies.
-
profile_d
=${PROFILE_HOME:-~}/.profile.d
+
PROFILE_D
=${PROFILE_HOME:-~}/.profile.d
deps=
unsorted=
deps=
unsorted=
- for i in $
profile_d
/{*/,}*.bashrc; do
+ for i in $
PROFILE_D
/{*/,}*.bashrc; do
dep=$(sed -n 's/^##*[ ]*profile-required:[ ]*//p' "$i")
dep=$(sed -n 's/^##*[ ]*profile-required:[ ]*//p' "$i")
- i="${i##$
profile_d
/}"
+ i="${i##$
PROFILE_D
/}"
if [ -n "$dep" ]; then
for d in $dep; do
deps="$deps
if [ -n "$dep" ]; then
for d in $dep; do
deps="$deps
@@
-74,9
+76,9
@@
$deps"
# Source them all in the right order.
sourced=
for i in $deps; do
# Source them all in the right order.
sourced=
for i in $deps; do
- for j in $
profile_d
/{,*/}$i; do
+ for j in $
PROFILE_D
/{,*/}$i; do
[ -e "$j" ] || continue
[ -e "$j" ] || continue
- k="${j##$
profile_d
/}"
+ k="${j##$
PROFILE_D
/}"
[ "${sourced/ $k /}" = "$sourced" ] || continue
. "$j"
sourced="$sourced $k "
[ "${sourced/ $k /}" = "$sourced" ] || continue
. "$j"
sourced="$sourced $k "
@@
-92,7
+94,7
@@
$deps"
# Reset LC_ALL.
LC_ALL=$lc_all
# Reset LC_ALL.
LC_ALL=$lc_all
- unset i j k d n dep deps p
rofile_d p
ath required unsorted sourced
+ unset i j k d n dep deps path required unsorted sourced
unset lc_all nullglob nocg
# Don't inherit failure from the last script.
unset lc_all nullglob nocg
# Don't inherit failure from the last script.