7 # loop because macos has no recursive resolution
8 while test -L "$cmdpath"; do
9 link="$(readlink "$cmdpath")"
10 cd "$(dirname "$cmdpath")"
13 script_home="$(cd "$(dirname "$cmdpath")" && pwd -P)"
16 bup_libdir="$script_home/../lib" # bup_libdir will be adjusted during install
17 export PYTHONPATH="$bup_libdir${PYTHONPATH:+:$PYTHONPATH}"
19 # Force python to use ISO-8859-1 (aka Latin 1), a single-byte
20 # encoding, to help avoid any manipulation of data from system APIs
21 # (paths, users, groups, command line arguments, etc.)
23 export PYTHONCOERCECLOCALE=0 # Perhaps not necessary, but shouldn't hurt
25 # We can't just export LC_CTYPE directly here because the locale might
26 # not exist outside python, and then bash (at least) may be cranky.
28 if [ "${LC_ALL+x}" ]; then
31 BUP_LC_ALL="$LC_ALL" \
32 LC_COLLATE="$LC_ALL" \
33 LC_MONETARY="$LC_ALL" \
34 LC_NUMERIC="$LC_ALL" \
36 LC_MESSAGES="$LC_ALL" \
39 elif [ "${LC_CTYPE+x}" ]; then
41 BUP_LC_CTYPE="$LC_CTYPE" \