]> arthur.barton.de Git - bup.git/blobdiff - lib/cmd/meta-cmd.py
README: reflect report that WSL works fine
[bup.git] / lib / cmd / meta-cmd.py
index 2f30ce8ced2c1e5a255b26aa7faccfdd692ac717..e9a3d61146f6a665e7abdd4d4b8c957991958ba9 100755 (executable)
@@ -1,7 +1,16 @@
 #!/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
 
@@ -13,8 +22,11 @@ exec "$bup_python" "$0" ${1+"$@"}
 # TODO: Add tar-like -C option.
 
 from __future__ import absolute_import
-import sys
-from bup import metadata
+import os, sys
+
+sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
+
+from bup import compat, metadata
 from bup import options
 from bup.compat import argv_bytes
 from bup.io import byte_stream
@@ -68,7 +80,7 @@ handle_ctrl_c()
 
 o = options.Options(optspec)
 (opt, flags, remainder) = o.parse(['--paths', '--symlinks', '--recurse']
-                                  + sys.argv[1:])
+                                  + compat.argv[1:])
 
 opt.verbose = opt.verbose or 0
 opt.quiet = opt.quiet or 0