3 # Path information is stored on separate lines in XXXdirs.
4 # We extract each directory exists and add it to the appropriate PATH.
7 # Location of the XXXdirs files.
10 # Set one path to be the same as another.
15 # Sanitise and export.
16 path="$(eval echo \$$oldpath)"
17 [ -z "$path" ] || eval export $newpath="$path"
19 unset path newpath oldpath
22 # Set a path from directories.
27 # Check the file exists.
28 [ -e "$DIR/$dirs" ] || return
30 # Set IFS to newline only so that we can read $(embedded shell commands).
37 dir=$(eval echo "$dir")
38 [ -d "$dir" ] || continue
50 [ -z "$path" ] && return
53 eval export $newpath="$path"
55 unset path newpath dirs
59 makepath C_INCLUDE_PATH incdirs
60 copypath CPLUS_INCLUDE_PATH C_INCLUDE_PATH
61 makepath LD_LIBRARY_PATH libdirs
62 copypath LD_RUN_PATH PATH
63 makepath MANPATH mandirs
64 makepath PKG_CONFIG_PATH pkgdirs
66 unset dirs copypath makepath newpath