]> arthur.barton.de Git - bup.git/blobdiff - lib/cmd/tag-cmd.py
Add bup map including test results to pytest items
[bup.git] / lib / cmd / tag-cmd.py
index 44c5b33f92aed6e73cd4fbd476c1dd080f5520d9..0d52677ad4b59ad9a35722a59690dc24e42e8082 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
 
@@ -9,7 +18,9 @@ from __future__ import absolute_import
 from binascii import hexlify
 import os, sys
 
-from bup import git, options
+sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
+
+from bup import compat, git, options
 from bup.compat import argv_bytes
 from bup.helpers import debug1, handle_ctrl_c, log
 from bup.io import byte_stream, path_msg
@@ -28,7 +39,7 @@ f,force     Overwrite existing tag, or ignore missing tag when deleting
 """
 
 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()