# essentially, we create a bup-save command for ourselves
# that gets an error for the .../5 file in metadata.from_path()
cat > "$tmpdir/bup-save" << EOF
-#!$top/cmd/bup-python
+#!/usr/bin/env $top/dev/bup-python
from bup import metadata
+
orig_from_path = metadata.from_path
def from_path(path, *args, **kw):
if path.endswith(b'/5'):
return orig_from_path(path, *args, **kw)
metadata.from_path = from_path
-exec(open("$top/cmd/bup-save", "rb").read())
+exec(open("$top/lib/cmd/bup-save", "rb").read())
EOF
chmod +x "$tmpdir/bup-save"
WVPASS bup index "$tmpdir/save"
cat > "$tmpdir/bup-save" << EOF
-#!$top/cmd/bup-python
+#!/usr/bin/env $top/dev/bup-python
from bup import metadata
+
orig_from_path = metadata.from_path
def from_path(path, *args, **kw):
if path.endswith(b'/a'):
return orig_from_path(path, *args, **kw)
metadata.from_path = from_path
-exec(open("$top/cmd/bup-save", "rb").read())
+exec(open("$top/lib/cmd/bup-save", "rb").read())
EOF
chmod +x "$tmpdir/bup-save"
WVPASS bup index "$tmpdir/save"
cat > "$tmpdir/bup-save" << EOF
-#!$top/cmd/bup-python
+#!/usr/bin/env $top/dev/bup-python
from bup import index
Reader = index.Reader
yield transname, ent
index.Reader = DupReader
-exec(open("$top/cmd/bup-save", "rb").read())
+exec(open("$top/lib/cmd/bup-save", "rb").read())
EOF
chmod +x "$tmpdir/bup-save"