X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=bup.git;a=blobdiff_plain;f=cmd%2Fpython-cmd.sh;h=cce1b8b7bde1dabea2e80cb2c5d374c8288a1faf;hp=6de5867309b89f7ee04dbd89cd20960d86da10b3;hb=3c64b5788c3e6b10528a81285b71da2edbed8950;hpb=3fa656946d28bb8cac061b745e2edc26bc2d56ae diff --git a/cmd/python-cmd.sh b/cmd/python-cmd.sh index 6de5867..cce1b8b 100644 --- a/cmd/python-cmd.sh +++ b/cmd/python-cmd.sh @@ -2,4 +2,20 @@ set -e +top="$(pwd)" +cmdpath="$0" +# loop because macos has no recursive resolution +while test -L "$cmdpath"; do + link="$(readlink "$cmdpath")" + cd "$(dirname "$cmdpath")" + cmdpath="$link" +done +script_home="$(cd "$(dirname "$cmdpath")" && pwd -P)" +cd "$top" + +bup_libdir="$script_home/../lib" # bup_libdir will be adjusted during install + +export PYTHONPATH="$bup_libdir${PYTHONPATH:+:$PYTHONPATH}" +export BUP_RESOURCE_PATH="$bup_libdir" + # This last line will be replaced with 'exec some/python "$@"