]> arthur.barton.de Git - bup.git/blobdiff - lib/cmd/import-duplicity-cmd.py
configure: check for <readline.h> vs <readline/readline.h>
[bup.git] / lib / cmd / import-duplicity-cmd.py
index 45666efa72a6aef4b30ad5a4e7c533539b8199b2..348be8cbbaa397b9620ca4b1ea3b2e67dd475d16 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,10 +20,13 @@ from pipes import quote
 from subprocess import check_call
 from time import strftime, strptime
 import os
+import os.path
 import sys
 import tempfile
 
-from bup import git, helpers, options
+sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
+
+from bup import compat, git, helpers, options
 from bup.compat import argv_bytes, str_type
 from bup.helpers import (handle_ctrl_c,
                          log,
@@ -31,7 +43,7 @@ n,dry-run  don't do anything; just print what would be done
 """
 
 def logcmd(cmd):
-    log(shstr(cmd).decode('iso-8859-1', errors='replace') + '\n')
+    log(shstr(cmd).decode(errors='backslashreplace') + '\n')
 
 def exc(cmd, shell=False):
     global opt
@@ -56,7 +68,7 @@ handle_ctrl_c()
 log('\nbup: import-duplicity is EXPERIMENTAL (proceed with caution)\n\n')
 
 o = options.Options(optspec)
-opt, flags, extra = o.parse(sys.argv[1:])
+opt, flags, extra = o.parse(compat.argv[1:])
 
 if len(extra) < 1 or not extra[0]:
     o.fatal('duplicity source URL required')