summaryrefslogtreecommitdiff
path: root/.local
diff options
context:
space:
mode:
authorLuke Shumaker <shumakl@purdue.edu>2014-04-21 11:57:06 -0400
committerLuke Shumaker <shumakl@purdue.edu>2014-04-21 11:57:06 -0400
commitf4453acbfdb1ac77a8bffc05635daf7aa3fee605 (patch)
tree29af6bb6b4f7189f9064046f64057350837b8c5d /.local
parentb087c44642ae8a22a58a3763ea1b595b4be0bc07 (diff)
touch up PATHs being set in login.sh
Diffstat (limited to '.local')
-rwxr-xr-x.local/bin/config-path24
1 files changed, 21 insertions, 3 deletions
diff --git a/.local/bin/config-path b/.local/bin/config-path
index 6b9019c..99f0910 100755
--- a/.local/bin/config-path
+++ b/.local/bin/config-path
@@ -24,28 +24,46 @@ in_array() {
# Import existing values
IFS=: paths=($PATH)
+IFS=: manpaths=($MANPATH)
IFS=: rubylibs=($RUBYLIB)
+IFS=: perl5libs=($PERL5LIB)
# Scan through prefixes
for prefix in "${prefixes[@]}"; do
# PATH
- dir="$prefix/bin"
- if [[ -d "$dir" ]] && ! in_array "$dir" "${paths[@]}"; then
- paths=("$dir" "${paths[@]}")
+ for dir in "$prefix/bin" "$prefix/sbin"; do
+ if [[ -d "$dir" ]] && ! in_array "$dir" "${paths[@]}"; then
+ paths=("$dir" "${paths[@]}")
+ fi
+ done
+ # MANPATH
+ dir="$prefix/share/man"
+ if [[ -d "$dir" ]] && ! in_array "$dir" "${manpaths[@]}"; then
+ manpaths=("$dir" "${manpaths[@]}")
fi
# RUBYLIB
dir="$prefix/lib"
if [[ -d "$dir" ]] && ! in_array "$dir" "${rubylibs[@]}"; then
rubylibs=("$dir" "${rubylibs[@]}")
fi
+ # PERL5LIB
+ for dir in "$prefix"/lib*/perl5; do
+ if [[ -d "$dir" ]] && in_array "$dir" "${manpaths[@]}"; then
+ perl5libs=("$dir" "${perl5libs[@]}")
+ fi
+ done
done
# Finally, print our values
IFS=: PATH="${paths[*]}"
+IFS=: MANPATH="${manpaths[*]}"
IFS=: RUBYLIB="${rubylibs[*]}"
+IFS=: PERL5LIB="${perl5libs[*]}"
# The sed bit here is the only time we call an external program
{
declare -p PATH
+ declare -p MANPATH
declare -p RUBYLIB
+ declare -p PERL5LIB
} | sed 's/^declare \(-\S* \)*//'