X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fcmd%2Fmargin-cmd.py;h=09411bc7778c0d5f643f8f6b520d334088879fcd;hb=73f4b83af6c73a0ba48e448883856bf24aacbf7d;hp=14e7cd7121167f36b74e09ef7d16f0fe2b2034e8;hpb=887534c033738bd6b19464ca180b049e131d06a5;p=bup.git diff --git a/lib/cmd/margin-cmd.py b/lib/cmd/margin-cmd.py index 14e7cd7..09411bc 100755 --- a/lib/cmd/margin-cmd.py +++ b/lib/cmd/margin-cmd.py @@ -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 sys, struct, math +import math, os.path, struct, sys -from bup import options, git, _helpers +sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..'] + +from bup import compat, options, git, _helpers from bup.helpers import log from bup.io import byte_stream @@ -21,7 +32,7 @@ predict Guess object offsets and report the maximum deviation ignore-midx Don't use midx files; use only plain pack idx files. """ o = options.Options(optspec) -(opt, flags, extra) = o.parse(sys.argv[1:]) +opt, flags, extra = o.parse(compat.argv[1:]) if extra: o.fatal("no arguments expected")