CONFIG: accept '-lib' for foamCleanPath

- simplfies differences for OSX
This commit is contained in:
Mark Olesen 2021-10-18 13:59:28 +02:00
parent 16d48ed047
commit 4a0646451d
11 changed files with 201 additions and 93 deletions

View File

@ -7,7 +7,7 @@
# \\/ M anipulation |
#------------------------------------------------------------------------------
# Copyright (C) 2011-2016 OpenFOAM Foundation
# Copyright (C) 2017-2020 OpenCFD Ltd.
# Copyright (C) 2017-2021 OpenCFD Ltd.
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
@ -43,22 +43,31 @@
# eval "$(foamCleanPath -sh=PATH "$PATH" dir1:dir2)"
# eval "$(foamCleanPath -sh=PATH -env=PATH dir1:dir2)"
# eval "$(foamCleanPath -sh-env=PATH dir1:dir2)"
# eval "$(foamCleanPath -sh-path dir1:dir2)"
#
# - Similarly for c-shell
# eval `foamCleanPath -csh-env=PATH dir1:dir2`
# eval `foamCleanPath -csh-path dir1:dir2`
#
# For library paths, it is suggested to use -sh-lib, or -csh-lib.
# The will use DYLD_LIBRARY_PATH instead of LD_LIBRARY_PATH on Darwin.
#
#------------------------------------------------------------------------------
printHelp() {
cat<<USAGE
Usage: foamCleanPath [OPTION] path [filter] .. [filter]
Usage: foamCleanPath [OPTION] ENV [filter] .. [filter]
foamCleanPath [OPTION] -env=name [filter] .. [filter]
options:
-env=NAME Evaluate NAME to obtain initial content
-csh=NAME Produce 'setenv NAME ...' output for csh eval
-csh-env=NAME Like -csh=NAME, with -env for initial content
-env=NAME Evaluate NAME to obtain initial content,
Accepts "-env=-path", "-env=-lib" shortcuts for PATH
and LD_LIBRARY_PATH (DYLD_LIBRARY_PATH on Darwin)
-sh=NAME Produce 'NAME=...' output for sh eval
-sh-env=NAME Like -sh=NAME, with -env for initial content
-csh=NAME Produce 'setenv NAME ...' output for csh eval
-sh-env=NAME Same as -sh=NAME -env=NAME
-csh-env=NAME Same as -csh=NAME -env=NAME
-sh-path | -csh-path Same as -[c]sh-env=PATH
-sh-lib | -csh-lib Same as -[c]sh-env=LD_LIBRARY_PATH
or DYLD_LIBRARY_PATH on Darwin
-debug Print debug information to stderr
-strip Remove inaccessible directories
-verbose Report some progress (input, output, ...)
@ -94,7 +103,7 @@ die()
#-------------------------------------------------------------------------------
# Input and outputs
unset dirList shellOutput
unset dirList shellOutput shellFlavour
unset optDebug optEnvName optStrip optVerbose
# Parse options
@ -106,31 +115,56 @@ do
;;
-env=*)
optEnvName="${1#*=}"
[ -n "$optEnvName" ] || die "Option '$1' missing an ENVNAME"
;;
-csh=* | -sh=* | -csh-env=* | -sh-env=*)
name="${1#*=}"
[ -n "$name" ] || die "Option '$1' missing an ENVNAME"
# For (-csh-env | -sh-env) also use name for input evaluation
case "$1" in
*-env=*)
optEnvName="$name"
name="$optEnvName"
# Accept aliases
case "$name" in
(-path) name='PATH';;
(-lib)
case "$(uname -s 2>/dev/null)" in
(Darwin) name='DYLD_LIBRARY_PATH';;
(*) name='LD_LIBRARY_PATH';;
esac
;;
esac
esac
optEnvName="$name" # Use for input evaluation
;;
# Shell-specific output prefix ("setenv ENVNAME xyz" or "ENVNAME=xyz")
case "$1" in
-csh*)
shellOutput="setenv $name "
;;
*)
shellOutput="$name="
-csh-path | -sh-path)
shellFlavour="$1"
name='PATH'
optEnvName="$name" # Use for input evaluation
shellOutput="$name" # Use for output
;;
-csh-lib | -sh-lib)
shellFlavour="$1"
case "$(uname -s 2>/dev/null)" in
(Darwin) name='DYLD_LIBRARY_PATH';;
(*) name='LD_LIBRARY_PATH';;
esac
optEnvName="$name" # Use for input evaluation
shellOutput="$name" # Use for output
;;
-csh=* | -sh=* | -csh-env=* | -sh-env=*)
shellFlavour="$1"
name="${1#*=}"
[ -n "$name" ] || die "Option '$1' missing an ENVNAME"
# Accept aliases
case "$name" in
(-path) name='PATH';;
(-lib)
case "$(uname -s 2>/dev/null)" in
(Darwin) name='DYLD_LIBRARY_PATH';;
(*) name='LD_LIBRARY_PATH';;
esac
;;
esac
shellOutput="$name" # Use for output
# Use for input evaluation
case "$1" in (*-env=*) optEnvName="$name";; esac
;;
-debug)
@ -149,6 +183,17 @@ do
shift
done
# Set the output prefix
# c-shell: setenv ENVNAME ...
# POSIX : ENVNAME=...
if [ -n "$shellOutput" ]
then
case "$shellFlavour" in
(-csh*) shellOutput="setenv ${shellOutput} " ;;
(*) shellOutput="${shellOutput}=" ;;
esac
fi
# Basic checks
if [ -n "$optEnvName" ]

View File

@ -7,7 +7,7 @@
# \\/ M anipulation |
#------------------------------------------------------------------------------
# Copyright (C) 2016-2017 CINECA
# Copyright (C) 2017-2020 OpenCFD Ltd.
# Copyright (C) 2017-2021 OpenCFD Ltd.
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
@ -327,14 +327,14 @@ fi
foamClean="$WM_PROJECT_DIR/bin/foamCleanPath"
if [ -x "$foamClean" ]
then
eval $("$foamClean" -sh-env=PATH "$foamOldDirs")
eval $("$foamClean" -sh-path "$foamOldDirs")
eval $("$foamClean" -sh-lib "$foamOldDirs")
eval $("$foamClean" -sh-env=MANPATH "$foamOldDirs")
eval $("$foamClean" -sh-env=LD_LIBRARY_PATH "$foamOldDirs")
# May not have/need any third party at all
if [ -n "$FOAM_EXT_LIBBIN" ] && [ ! -d "$FOAM_EXT_LIBBIN" ]
then
eval $("$foamClean" -sh-env=LD_LIBRARY_PATH "$FOAM_EXT_LIBBIN")
eval $("$foamClean" -sh-lib "$FOAM_EXT_LIBBIN")
unset FOAM_EXT_LIBBIN
fi
fi

View File

@ -19,18 +19,34 @@
#
# Some functionality implemented via bin/tools/lib-dir
#
# Defined Variables
# foamClean : path to bin/foamCleanPath
# _foam_uname_s : cache value for `uname -s`
#
# Defined Functions (Aliases)
# _foamClean : eval call to foamCleanPath for specific shell
# _foamEcho : silent/non-silent echo
# _foamEtc : resolve etc files (silent or verbose)
# _foamAddPath : prepend to MANPATH
# _foamAddMan : prepend to MANPATH
# _foamAddLib : prepend to [DY]LD_LIBRARY_PATH
# _foamAddLibAuto: call to lib-dir for lib64/lib resolved name
#
#------------------------------------------------------------------------------
# Cleaning environment variables
alias _foamClean 'eval `$WM_PROJECT_DIR/bin/foamCleanPath -csh-env=\!*`'
# Cache value for `uname -s`
set _foam_uname_s=`uname -s`
# Prepend PATH, MANPATH, LD_LIBRARY_PATH
alias _foamAddPath 'setenv PATH \!*\:${PATH}'
alias _foamAddMan 'setenv MANPATH \!*\:${MANPATH}'
# Special treatment for Darwin
# - DYLD_LIBRARY_PATH instead of LD_LIBRARY_PATH
if (`uname -s` == "Darwin") then
if ("${_foam_uname_s}" == "Darwin") then
alias _foamAddLib 'setenv DYLD_LIBRARY_PATH \!*\:${DYLD_LIBRARY_PATH}'
else
alias _foamAddLib 'setenv LD_LIBRARY_PATH \!*\:${LD_LIBRARY_PATH}'

View File

@ -66,8 +66,8 @@ if (! $?WM_COMPILER_LIB_ARCH ) setenv WM_COMPILER_LIB_ARCH
set archDir="$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER"
# Clean path and library path
eval `$WM_PROJECT_DIR/bin/foamCleanPath -csh-env=PATH "$ParaView_DIR $archDir/ParaView- $archDir/qt-"`
eval `$WM_PROJECT_DIR/bin/foamCleanPath -csh-env=LD_LIBRARY_PATH "$ParaView_DIR $archDir/ParaView- $archDir/qt-"`
eval `$WM_PROJECT_DIR/bin/foamCleanPath -csh-path "$ParaView_DIR $archDir/ParaView- $archDir/qt-"`
eval `$WM_PROJECT_DIR/bin/foamCleanPath -csh-lib "$ParaView_DIR $archDir/ParaView- $archDir/qt-"`
# Evaluate command-line parameters for ParaView
while ( $#argv > 0 )
@ -156,6 +156,7 @@ default:
if ( -r "$ParaView_DIR" ) then
setenv PATH "${ParaView_DIR}/bin:${PATH}"
set pvLibDir="unknown"
set pv_libdirs=""
# QT libraries as required, and Qt5_DIR for the root directory.
# Another possibility: "qtpaths --qt-version"
@ -168,7 +169,7 @@ default:
endsw
foreach libDir ("lib$WM_COMPILER_LIB_ARCH" "lib")
if ( -d "${qtDir}/${libDir}" ) then
setenv LD_LIBRARY_PATH "${qtDir}/${libDir}:${LD_LIBRARY_PATH}"
set pv_libdirs="${qtDir}/${libDir}:${pv_libdirs}"
break
endif
end
@ -186,7 +187,7 @@ default:
set libDir="$pvLibDir" # Needs lib/paraview-X.X (not lib)
breaksw
endsw
setenv LD_LIBRARY_PATH "${ParaView_DIR}/${libDir}:${LD_LIBRARY_PATH}"
set pv_libdirs="${ParaView_DIR}/${libDir}:${pv_libdirs}"
break
endif
set pvLibDir="unknown"
@ -200,6 +201,19 @@ default:
set pv_plugin_dir="${pv_plugin_dir} (missing)" # For message
endif
# Any extra library directories
if ( -n "$pv_libdirs" != "" ) then
switch "WM_ARCH" in
case darwin*:
setenv DYLD_LIBRARY_PATH "${pv_libdirs}:$DYLD_LIBRARY_PATH"
breaksw
default:
setenv LD_LIBRARY_PATH "${pv_libdirs}:$LD_LIBRARY_PATH"
breaksw
endsw
endif
if ($?FOAM_VERBOSE && $?prompt) then
echo "Using paraview"
echo " ParaView_DIR : $ParaView_DIR"
@ -225,6 +239,6 @@ endif
unsetenv ParaView_VERSION ParaView_QT
unset archDir libDir
unset pv_api pv_plugin_dir pvLibDir pvPython qtDir
unset pv_api pv_plugin_dir pv_libdirs pvLibDir pvPython qtDir
#------------------------------------------------------------------------------

View File

@ -145,16 +145,19 @@ if ( $?FOAM_CONFIG_ETC ) then
endif
# Clean standard environment variables (PATH, MANPATH, LD_LIBRARY_PATH)
# Clean standard environment variables (PATH, MANPATH, [DY]LD_LIBRARY_PATH)
# - avoid local variables shadowing setenv variables
unset PATH MANPATH LD_LIBRARY_PATH DYLD_LIBRARY_PATH
if (! $?MANPATH ) setenv MANPATH
if (! $?LD_LIBRARY_PATH ) setenv LD_LIBRARY_PATH
if ("${_foam_uname_s}" == "Darwin" ) then
if (! $?DYLD_LIBRARY_PATH ) setenv DYLD_LIBRARY_PATH
endif
_foamClean PATH "$foamOldDirs"
_foamClean MANPATH "$foamOldDirs"
_foamClean LD_LIBRARY_PATH "$foamOldDirs"
_foamClean -lib "$foamOldDirs"
#------------------------------------------------------------------------------
@ -207,9 +210,9 @@ endif
# Remove duplicates from environment paths
_foamClean PATH
_foamClean MANPATH
_foamClean LD_LIBRARY_PATH
_foamClean PATH "$foamOldDirs"
_foamClean MANPATH "$foamOldDirs"
_foamClean -lib
# Add trailing ':' for system manpages
if ( $?MANPATH ) then
@ -239,6 +242,6 @@ unalias _foamAddLib
unalias _foamAddLibAuto
# Variables (done as final statement for a clean exit code)
unset cleaned foamOldDirs _foamFoundDir _foamPrefixDir
unset cleaned foamOldDirs _foam_uname_s _foamFoundDir _foamPrefixDir
#------------------------------------------------------------------------------

View File

@ -6,7 +6,7 @@
# \\/ M anipulation |
#------------------------------------------------------------------------------
# Copyright (C) 2011-2016 OpenFOAM Foundation
# Copyright (C) 2016-2020 OpenCFD Ltd.
# Copyright (C) 2016-2021 OpenCFD Ltd.
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
@ -153,19 +153,26 @@ unsetenv SCOTCH_ARCH_PATH
# PATH, LD_LIBRARY_PATH, MANPATH
if ( $?foamClean ) then
eval `$foamClean -csh-env=PATH "$foamOldDirs"`
if ($?LD_LIBRARY_PATH) then
eval `$foamClean -csh-env=LD_LIBRARY_PATH "$foamOldDirs"`
if ("${LD_LIBRARY_PATH}" == "") unsetenv LD_LIBRARY_PATH
endif
if ($?MANPATH) then
eval `$foamClean -csh-env=MANPATH "$foamOldDirs"`
if ("${MANPATH}" == "") unsetenv MANPATH
endif
if ($?LD_LIBRARY_PATH) then
eval `$foamClean -csh-env=LD_LIBRARY_PATH "$foamOldDirs"`
endif
if ($?DYLD_LIBRARY_PATH) then
eval `$foamClean -csh-env=DYLD_LIBRARY_PATH "$foamOldDirs"`
endif
endif
if ($?MANPATH) then
if ("${MANPATH}" == "") unsetenv MANPATH
endif
if ($?LD_LIBRARY_PATH) then
if ("${LD_LIBRARY_PATH}" == "") unsetenv LD_LIBRARY_PATH
endif
if ($?DYLD_LIBRARY_PATH) then
if ("${DYLD_LIBRARY_PATH}" == "") unsetenv DYLD_LIBRARY_PATH
endif

View File

@ -20,6 +20,20 @@
#
# Some functionality mirrored by bin/tools/lib-dir
#
# Defined Variables
# WM_SHELL_FUNCTIONS : tracking variable
# foamClean : path to bin/foamCleanPath
# _foam_uname_s : cache value for `uname -s`
#
# Defined Functions
# _foamClean : eval call to foamCleanPath for specific shell
# _foamEcho : silent/non-silent echo
# _foamEtc : resolve etc files (silent or verbose)
# _foamAddPath : prepend to MANPATH
# _foamAddMan : prepend to MANPATH
# _foamAddLib : prepend to [DY]LD_LIBRARY_PATH
# _foamAddLibAuto: prepend to lib64/lib resolved name
#
#------------------------------------------------------------------------------
if [ -z "$WM_SHELL_FUNCTIONS" ]
@ -32,6 +46,9 @@ then
# Cleaning environment variables
foamClean="$WM_PROJECT_DIR/bin/foamCleanPath"
# Cache value for `uname -s`
_foam_uname_s="$(uname -s 2>/dev/null)"
# Cleaning environment variables
unset -f _foamClean 2>/dev/null
_foamClean()
@ -70,12 +87,25 @@ then
case "$1" in (/?*) export MANPATH="$1:$MANPATH" ;; esac
}
# Prepend LD_LIBRARY_PATH
# Prepend LD_LIBRARY_PATH (DYLD_LIBRARY_PATH for Darwin)
unset -f _foamAddLib 2>/dev/null
_foamAddLib()
{
case "$1" in (/?*) export LD_LIBRARY_PATH="$1:$LD_LIBRARY_PATH" ;; esac
}
if [ "${_foam_uname_s}" = Darwin ]
then
_foamAddLib()
{
case "$1" in (/?*)
export DYLD_LIBRARY_PATH="${1}${DYLD_LIBRARY_PATH:+:}${DYLD_LIBRARY_PATH}" ;;
esac
}
else
_foamAddLib()
{
case "$1" in (/?*)
export LD_LIBRARY_PATH="${1}${LD_LIBRARY_PATH:+:}${LD_LIBRARY_PATH}" ;;
esac
}
fi
# Prepend to LD_LIBRARY_PATH with additional checking
# $1 = base directory for 'lib' or 'lib64'
@ -106,7 +136,7 @@ then
do
if [ -d "$foamVar_prefix/$foamVar_end" ]
then
export LD_LIBRARY_PATH="$foamVar_prefix/$foamVar_end:$LD_LIBRARY_PATH"
_foamAddLib "$foamVar_prefix/$foamVar_end"
unset foamVar_prefix foamVar_end
return 0
fi
@ -119,10 +149,10 @@ then
then
case "$foamVar_end" in
(/*) # Absolute path
export LD_LIBRARY_PATH="$foamVar_end:$LD_LIBRARY_PATH"
_foamAddLib "foamVar_end"
;;
(*) # Relative to prefix
export LD_LIBRARY_PATH="$foamVar_prefix/$foamVar_end:$LD_LIBRARY_PATH"
_foamAddLib "$foamVar_prefix/$foamVar_end"
;;
esac
unset foamVar_prefix foamVar_end
@ -134,27 +164,6 @@ then
}
# Special treatment for Darwin
# - DYLD_LIBRARY_PATH instead of LD_LIBRARY_PATH
if [ "$(uname -s 2>/dev/null)" = Darwin ]
then
unset -f _foamAddLib _foamAddLibAuto 2>/dev/null
# Prepend DYLD_LIBRARY_PATH
_foamAddLib()
{
case "$1" in (/?*) export DYLD_LIBRARY_PATH="$1:$DYLD_LIBRARY_PATH" ;; esac
}
# Prepend to DYLD_LIBRARY_PATH with additional checking
# - use lib-dir script instead of rewriting
_foamAddLibAuto()
{
eval "$("$WM_PROJECT_DIR"/bin/tools/lib-dir -sh "$@")";
}
fi
#--------------------------------------------------------------------------
# Avoid any ThirdParty settings that may have 'leaked' into the environment
@ -180,6 +189,7 @@ else
unset -f _foamAddPath _foamAddMan _foamAddLib _foamAddLibAuto 2>/dev/null
unset -f _foamClean _foamEcho _foamEtc 2>/dev/null
unset foamClean
unset _foam_uname_s
unset WM_SHELL_FUNCTIONS
fi

View File

@ -69,11 +69,11 @@ archDir="$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER"
# Clean path and library path
eval \
"$($WM_PROJECT_DIR/bin/foamCleanPath -sh-env=PATH \
"$($WM_PROJECT_DIR/bin/foamCleanPath -sh-path \
$ParaView_DIR $archDir/ParaView- $archDir/qt-)"
eval \
"$($WM_PROJECT_DIR/bin/foamCleanPath -sh-env=LD_LIBRARY_PATH \
"$($WM_PROJECT_DIR/bin/foamCleanPath -sh-lib \
$ParaView_DIR $archDir/ParaView- $archDir/qt-)"
# Evaluate command-line parameters for ParaView
@ -131,6 +131,7 @@ case "$ParaView_VERSION" in
if [ -r "$ParaView_DIR" ]
then
export PATH="$ParaView_DIR/bin:$PATH"
unset pv_libdirs
# QT libraries as required, and Qt5_DIR for the root directory.
# Another possibility: "qtpaths --qt-version"
@ -146,7 +147,7 @@ case "$ParaView_VERSION" in
do
if [ -d "$qtDir/$libDir" ]
then
export LD_LIBRARY_PATH="$qtDir/$libDir:$LD_LIBRARY_PATH"
pv_libdirs="$qtDir/$libDir"
break
fi
done
@ -165,7 +166,7 @@ case "$ParaView_VERSION" in
libDir="$pvLibDir" # Needs lib/paraview-X.X (not lib)
;;
esac
export LD_LIBRARY_PATH="$ParaView_DIR/$libDir:$LD_LIBRARY_PATH"
pv_libdirs="$ParaView_DIR/$libDir:${pv_libdirs}"
break
fi
unset pvLibDir
@ -180,6 +181,16 @@ case "$ParaView_VERSION" in
pv_plugin_dir="${pv_plugin_dir} (missing)" # For message
fi
# Any extra library directories
if [ -n "$pv_libdirs" ]
then
case "$WM_ARCH" in
(darwin*)
export DYLD_LIBRARY_PATH="${pv_libdirs}:$DYLD_LIBRARY_PATH" ;;
(*) export LD_LIBRARY_PATH="${pv_libdirs}:$LD_LIBRARY_PATH" ;;
esac
fi
if [ -n "$FOAM_VERBOSE" ] && [ -n "$PS1" ]
then
echo "Using paraview" 1>&2
@ -208,6 +219,6 @@ then
fi
unset archDir libDir
unset pv_api pv_plugin_dir pvLibDir pvPython qtDir
unset pv_api pv_plugin_dir pv_libdirs pvLibDir pvPython qtDir
#------------------------------------------------------------------------------

View File

@ -5,7 +5,7 @@
# \\ / A nd | www.openfoam.com
# \\/ M anipulation |
#------------------------------------------------------------------------------
# Copyright (C) 2019-2020 OpenCFD Ltd.
# Copyright (C) 2019-2021 OpenCFD Ltd.
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
@ -27,11 +27,11 @@ archDir="$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER"
# Clean path and library path
eval \
"$($WM_PROJECT_DIR/bin/foamCleanPath -sh-env=PATH \
"$($WM_PROJECT_DIR/bin/foamCleanPath -sh-path \
$ParaView_DIR $archDir/ParaView-)"
eval \
"$($WM_PROJECT_DIR/bin/foamCleanPath -sh-env=LD_LIBRARY_PATH \
"$($WM_PROJECT_DIR/bin/foamCleanPath -sh-lib \
$ParaView_DIR $archDir/ParaView-)"
#------------------------------------------------------------------------------

View File

@ -186,7 +186,7 @@ fi
export PATH MANPATH LD_LIBRARY_PATH
_foamClean PATH "$foamOldDirs"
_foamClean MANPATH "$foamOldDirs"
_foamClean LD_LIBRARY_PATH "$foamOldDirs"
_foamClean -lib "$foamOldDirs"
#------------------------------------------------------------------------------
# Base setup (OpenFOAM compilation), MPI and third-party packages
@ -244,7 +244,7 @@ export PATH MANPATH LD_LIBRARY_PATH
_foamClean PATH
_foamClean MANPATH
_foamClean LD_LIBRARY_PATH
_foamClean -lib
# Add trailing ':' for system manpages
if [ -n "$MANPATH" ]

View File

@ -6,7 +6,7 @@
# \\/ M anipulation |
#------------------------------------------------------------------------------
# Copyright (C) 2011-2016 OpenFOAM Foundation
# Copyright (C) 2016-2020 OpenCFD Ltd.
# Copyright (C) 2016-2021 OpenCFD Ltd.
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
@ -154,12 +154,14 @@ unset SCOTCH_ARCH_PATH
if [ -n "$foamClean" ]
then
eval "$($foamClean -sh-env=PATH $foamOldDirs)"
eval "$($foamClean -sh-env=LD_LIBRARY_PATH $foamOldDirs)"
eval "$($foamClean -sh-env=MANPATH $foamOldDirs)"
eval "$($foamClean -sh-env=LD_LIBRARY_PATH $foamOldDirs)"
eval "$($foamClean -sh-env=DYLD_LIBRARY_PATH $foamOldDirs)"
fi
[ -n "$LD_LIBRARY_PATH" ] || unset LD_LIBRARY_PATH
[ -n "$MANPATH" ] || unset MANPATH
[ -n "$LD_LIBRARY_PATH" ] || unset LD_LIBRARY_PATH
[ -n "$DYLD_LIBRARY_PATH" ] || unset DYLD_LIBRARY_PATH
#------------------------------------------------------------------------------
# Cleanup aliases and functions