]> arthur.barton.de Git - bup.git/blobdiff - lib/cmd/ftp-cmd.py
Add bup-features to report status; drop ACL warnings
[bup.git] / lib / cmd / ftp-cmd.py
index 30e523de940f5041e4282e9434e44ebfb2f32b32..732082abbbbd1a49e870d10ffc8b7b1257223d14 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
 
@@ -11,9 +20,11 @@ exec "$bup_python" "$0" ${1+"$@"}
 # (e.g. ISO-8859-1).
 
 from __future__ import absolute_import, print_function
-import sys, os, stat, fnmatch
+import os, fnmatch, stat, sys
 
-from bup import _helpers, options, git, shquote, ls, vfs
+sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
+
+from bup import _helpers, compat, options, git, shquote, ls, vfs
 from bup.compat import argv_bytes
 from bup.helpers import chunkyreader, handle_ctrl_c, log
 from bup.io import byte_stream, path_msg
@@ -115,7 +126,7 @@ optspec = """
 bup ftp [commands...]
 """
 o = options.Options(optspec)
-(opt, flags, extra) = o.parse(sys.argv[1:])
+opt, flags, extra = o.parse(compat.argv[1:])
 
 git.check_repo_or_die()