]> arthur.barton.de Git - bup.git/blobdiff - dev/subtree-hash
Context manage connections (via BaseConn)
[bup.git] / dev / subtree-hash
index e3468fb57093e2fb54e0ada1f1d845ed450c5bb6..f0a3f6fc162f45a3890850a19f04d1efe59efdf6 100755 (executable)
@@ -1,16 +1,13 @@
 #!/bin/sh
 """": # -*-python-*-
-bup_python="$(dirname "$0")/bup-python" || exit $?
-exec "$bup_python" "$0" ${1+"$@"}
+bup_exec="$(dirname "$0")/bup-exec" || exit $?
+exec "$bup_exec" "$0" ${1+"$@"}
 """
-# end of bup preamble
 
 from __future__ import absolute_import, print_function
 import os.path, sys
 
-sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/../lib']
-
-from bup.compat import argv_bytes
+from bup.compat import argv_bytes, get_argvb
 from bup.helpers import handle_ctrl_c, readpipe
 from bup.io import byte_stream
 from bup import options
@@ -24,7 +21,7 @@ subtree-hash ROOT_HASH [PATH_ITEM...]
 handle_ctrl_c()
 
 o = options.Options(optspec)
-(opt, flags, extra) = o.parse(sys.argv[1:])
+opt, flags, extra = o.parse_bytes(get_argvb()[1:])
 
 if len(extra) < 1:
     o.fatal('must specify a root hash')