X-Git-Url: https://arthur.barton.de/gitweb/?a=blobdiff_plain;f=lib%2Fcmd%2Fsplit-cmd.py;h=d9cdc7ed2b2934e55d23202476612c706c945c65;hb=a4f58b2e4bb1a0208a9cec4b76a596d36134a881;hp=bb4cf2e619bbb178c9974bed4e166b9776af8ba8;hpb=ed4c09941a1f9df13ea3cd6a7522327c4009c8e4;p=bup.git diff --git a/lib/cmd/split-cmd.py b/lib/cmd/split-cmd.py index bb4cf2e..d9cdc7e 100755 --- a/lib/cmd/split-cmd.py +++ b/lib/cmd/split-cmd.py @@ -1,7 +1,16 @@ #!/bin/sh """": # -*-python-*- +# 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")/bup-python" || exit $? -exec "$bup_python" "$0" ${1+"$@"} +exec "$bup_python" "$0" """ # end of bup preamble @@ -9,7 +18,7 @@ from __future__ import absolute_import, division, print_function from binascii import hexlify import os, sys, time -from bup import hashsplit, git, options, client +from bup import compat, hashsplit, git, options, client from bup.compat import argv_bytes, environ from bup.helpers import (add_error, handle_ctrl_c, hostname, log, parse_num, qprogress, reprogress, saved_errors, @@ -49,7 +58,7 @@ bwlimit= maximum bytes/sec to transmit to server handle_ctrl_c() o = options.Options(optspec) -(opt, flags, extra) = o.parse(sys.argv[1:]) +opt, flags, extra = o.parse(compat.argv[1:]) if opt.name: opt.name = argv_bytes(opt.name) if opt.remote: opt.remote = argv_bytes(opt.remote) if opt.verbose is None: opt.verbose = 0 @@ -211,7 +220,7 @@ if opt.verbose: if opt.tree: out.write(hexlify(tree) + b'\n') if opt.commit or opt.name: - msg = b'bup split\n\nGenerated by command:\n%r\n' % sys.argv + msg = b'bup split\n\nGenerated by command:\n%r\n' % compat.argvb ref = opt.name and (b'refs/heads/%s' % opt.name) or None userline = b'%s <%s@%s>' % (userfullname(), username(), hostname()) commit = pack_writer.new_commit(tree, oldref, userline, date, None,