Compute bup_t_lib_script_home once at load time so that it won't be
affected by changes to pwd, and use it in realpath.
Signed-off-by: Rob Browning <rlb@defaultvalue.org>
# Assumes shell is Bash, and pipefail is set.
+bup_t_lib_script_home=$(cd "$(dirname $0)" && pwd)
+
force-delete()
{
local rc=0
realpath()
{
test "$#" -eq 1 || return $?
- local script_home=$(cd "$(dirname $0)" && pwd)
echo "$1" | \
- PYTHONPATH="${script_home}/../lib" python -c \
+ PYTHONPATH="$bup_t_lib_script_home/../lib" python -c \
"import sys, bup.helpers; print bup.helpers.realpath(sys.stdin.readline())" \
|| return $?
}