X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=dev%2Fmake-random-paths;h=c0c6c78736c70a87bfc09216b0b41027a14feac8;hb=4d9dd65141326b0f3ffa1658a0535348940ed017;hp=05d24f4ebdb2f6a131824bf3fa040a28d349b84f;hpb=8be9277b4d12e5649f76c166e177c5feef10931a;p=bup.git diff --git a/dev/make-random-paths b/dev/make-random-paths index 05d24f4..c0c6c78 100755 --- a/dev/make-random-paths +++ b/dev/make-random-paths @@ -1,19 +1,19 @@ #!/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 from os.path import abspath, dirname from random import randint -from sys import argv, exit, stderr, stdout +from sys import stderr, stdout import errno, re, sys -from bup.compat import fsencode, range +from bup.compat import fsencode, get_argv, get_argvb, range +argv = get_argv() def usage(out=stdout): print('Usage:', argv[0], 'NUM', 'DEST_DIR', file=out) @@ -44,10 +44,10 @@ def random_filename(): if len(argv) != 3: misuse() -count, dest = argv[1:] +count, dest = get_argvb()[1:] count = int(count) i = 0 while i < count: - with open(fsencode(dest) + b'/' + random_filename(), 'w') as _: + with open(dest + b'/' + random_filename(), 'w') as _: i += 1