1 # Path information is stored on separate lines in XXXdirs.
2 # We extract each directory exists and add it to the appropriate PATH.
5 # Location of the XXXdirs files.
8 # Set one path to be the same as another.
13 # Sanitise and export.
14 path="$(eval echo \$$oldpath)"
15 [ -z "$path" ] || eval "export $newpath='$path'"
17 unset path newpath oldpath
20 # Set a path from directories.
25 # Check the file exists.
26 [ -e "$DIR/$dirs" ] || return
28 # Set IFS to newline only so that we can read $(embedded shell commands).
35 dir=$(eval echo "$dir")
36 [ -d "$dir" ] || continue
48 [ -z "$path" ] && return
51 eval "export $newpath='$path'"
53 unset path newpath dirs
57 makepath C_INCLUDE_PATH incdirs
58 copypath CPLUS_INCLUDE_PATH C_INCLUDE_PATH
59 makepath LD_LIBRARY_PATH libdirs
60 copypath LD_RUN_PATH PATH
61 makepath MANPATH mandirs
62 makepath PKG_CONFIG_PATH pkgdirs
64 unset dirs copypath makepath newpath