]> arthur.barton.de Git - bup.git/blobdiff - lib/cmd/mux-cmd.py
README: reflect report that WSL works fine
[bup.git] / lib / cmd / mux-cmd.py
index f7be4c2f96da49f5b4accf636a84809cd94b67de..a3b4d57a512cdc7f6114711f17234d1eb7ca3a11 100755 (executable)
@@ -1,14 +1,25 @@
 #!/bin/sh
 """": # -*-python-*-
-bup_python="$(dirname "$0")/bup-python" || exit $?
-exec "$bup_python" "$0" ${1+"$@"}
+# https://sourceware.org/bugzilla/show_bug.cgi?id=26034
+export "BUP_ARGV_0"="$0"
+arg_i=1
+for arg in "$@"; do
+    export "BUP_ARGV_${arg_i}"="$arg"
+    shift
+    arg_i=$((arg_i + 1))
+done
+# Here to end of preamble replaced during install
+bup_python="$(dirname "$0")/../../config/bin/python" || exit $?
+exec "$bup_python" "$0"
 """
 # end of bup preamble
 
 from __future__ import absolute_import
-import os, sys, subprocess, struct
+import os, struct, subprocess, sys
 
-from bup import options
+sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
+
+from bup import compat, options
 from bup.helpers import debug1, debug2, mux
 from bup.io import byte_stream
 
@@ -23,7 +34,7 @@ bup mux command [arguments...]
 --
 """
 o = options.Options(optspec)
-(opt, flags, extra) = o.parse(sys.argv[1:])
+opt, flags, extra = o.parse(compat.argv[1:])
 if len(extra) < 1:
     o.fatal('command is required')