$(current_sampledata):
t/configure-sampledata --setup
-
-bup_libdir="$script_home/../lib" # bup_libdir will be adjusted during install
-
-define install-bup-python
- set -e; \
- sed -e 's|.*# bup_libdir will be adjusted during install|bup_libdir="$$script_home/.."|' $1 > $2; \
- chmod 0755 $2;
-endef
-
PANDOC ?= $(shell type -p pandoc)
ifeq (,$(PANDOC))
test -z "$(man_roff)" || $(INSTALL) -m 0644 $(man_roff) $(dest_mandir)/man1
test -z "$(man_html)" || install -d $(dest_docdir)
test -z "$(man_html)" || $(INSTALL) -m 0644 $(man_html) $(dest_docdir)
- $(INSTALL) -pm 0755 cmd/bup $(dest_libdir)/cmd/
- $(INSTALL) -pm 0755 cmd/bup-* $(dest_libdir)/cmd/
- $(call install-bup-python,cmd/bup-python,"$(dest_libdir)/cmd/bup-python")
+ dev/install-python-script lib/cmd/bup "$(dest_libdir)/cmd/bup"
+ set -e; \
+ for cmd in $$(ls cmd/bup-* | grep -v cmd/bup-python); do \
+ dev/install-python-script "$$cmd" "$(dest_libdir)/$$cmd"; \
+ done
cd "$(dest_bindir)" && \
ln -sf "$$($(bup_python) -c 'import os; print(os.path.relpath("$(abspath $(dest_libdir))/cmd/bup"))')"
set -e; \
distcheck: all
./wvtest run t/test-release-archive.sh
-cmd/bup-python: cmd/python-cmd.sh config/config.var/bup-python
- "$$(cat config/config.var/bup-python)" dev/replace -l '@bup_python@' \
- "$$(dev/shquote < config/config.var/bup-python)" \
- < "$<" > "$@".$$PPID.tmp
- chmod +x "$@".$$PPID.tmp
- mv "$@".$$PPID.tmp "$@"
+cmd/bup-python: config/config.var/bup-python
+ cd cmd && ln -sf "$$(< $(CURDIR)/config/config.var/bup-python)" bup-python
long-test: export BUP_TEST_LEVEL=11
long-test: test
Solaris, or Windows (with Cygwin, and maybe with WSL). Patches to
support other platforms are welcome.
+ - Until resolved, a [glibc bug](https://sourceware.org/bugzilla/show_bug.cgi?id=26034)
+ might cause bup to crash on startup for some (unusual) command line
+ argument values, when bup is configured to use Python 3.
+
- Any items in "Things that are stupid" below.
+++ /dev/null
-lib/cmd/bup
\ No newline at end of file
--- /dev/null
+#!/bin/sh
+
+# This is just a convenience wrapper. It's not a symlink because bup
+# finds its code relative to dirname(__file__).
+
+exec $(dirname "$0")/cmd/bup "$@"
from wvtest import WVPASSEQ, wvfailure_count
from bup import helpers
-from bup.compat import str_type
+from bup.compat import fsencode, str_type
from bup.io import byte_stream
# Assumes (of course) this file is at the top-level of the source tree
-_bup_tmp = realpath(dirname(__file__.encode('iso-8859-1')) + b'/t/tmp')
+_bup_tmp = realpath(dirname(fsencode(__file__))) + b'/t/tmp'
try:
os.makedirs(_bup_tmp)
except OSError as e:
if isinstance(cmd, str_type):
print(s, file=sys.stderr)
else:
- # bytes - for now just continue to pass it through given
- # bup-python wrapper
- print(s.decode('iso-8859-1'), file=sys.stderr)
+ # bytes - for now just escape it
+ print(s.decode(errors='backslashreplace'), file=sys.stderr)
def ex(cmd, **kwargs):
"""Print cmd to stderr and then run it as per ex(...).
AC_SUB bup_make "$MAKE"
-bup_python="$PYTHON"
+bup_python="$(type -p "$PYTHON")"
test -z "$bup_python" && bup_python="$(bup_find_prog python2.7 '')"
test -z "$bup_python" && bup_python="$(bup_find_prog python2.6 '')"
test -z "$bup_python" && bup_python="$(bup_find_prog python2 '')"
--- /dev/null
+#!/bin/sh
+"""": # -*-python-*-
+exec env LC_CTYPE=iso-8859-1 python "$0" ${1+"$@"}
+"""
+
+from __future__ import absolute_import, print_function
+from tempfile import NamedTemporaryFile
+import os, shutil, sys
+
+if sys.version_info[0] >= 3:
+ from shlex import quote
+else:
+ from pipes import quote
+
+src_path, dest_path = sys.argv[1:]
+
+with open(b'config/config.var/bup-python', 'rb') as src:
+ python = src.read()
+
+with NamedTemporaryFile() as tmp:
+ # Replace the section between "Here to end..." and the end of the
+ # preamble with the correct 'exec PYTHON "$0"'.
+ with open(src_path, 'rb') as src:
+ for line in src:
+ if line.startswith(b'# Here to end of preamble replaced during install'):
+ break
+ tmp.write(line)
+ for line in src:
+ if line == b'"""\n':
+ break
+ tmp.write(b'exec %s "$0"\n' % python)
+ tmp.write(b'"""\n')
+ for line in src:
+ tmp.write(line)
+ tmp.flush()
+ shutil.copy(tmp.name, dest_path)
+ os.chmod(dest_path, 0o755)
+++ /dev/null
-#!/bin/sh
-"""": # -*-python-*-
-exec env LC_CTYPE=iso-8859-1 python "$0" ${1+"$@"}
-"""
-
-from __future__ import absolute_import, print_function
-import sys
-
-py_maj = sys.version_info[0]
-
-import argparse
-if py_maj > 2:
- byte_stream = lambda x: x.buffer
- from os import fsencode
-else:
- byte_stream = lambda x: x
- fsencode = lambda x: x
-
-parser = argparse.ArgumentParser()
-parser.add_argument('-l', nargs=2, metavar=('ORIG', 'NEW'), action='append',
- help='literally replace ORIG with NEW')
-opt = parser.parse_args()
-
-sys.stdout.flush()
-with byte_stream(sys.stdin) as stdin:
- content = stdin.read()
-for orig, new in opt.l:
- content = content.replace(fsencode(orig), fsencode(new))
-byte_stream(sys.stdout).write(content)
if py3:
from os import environb as environ
-
- lc_ctype = environ.get(b'LC_CTYPE')
- if lc_ctype and lc_ctype.lower() != b'iso-8859-1':
- # Because of argv, options.py, pwd, grp, and any number of other issues
- print('error: bup currently only works with ISO-8859-1, not LC_CTYPE=%s'
- % lc_ctype.decode(),
- file=sys.stderr)
- print('error: this should already have been arranged, so indicates a bug',
- file=sys.stderr)
- sys.exit(2)
-
from os import fsdecode, fsencode
from shlex import quote
input = input
_configure_argv()
-def restore_lc_env():
- # Once we're up and running with iso-8859-1, undo the bup-python
- # LC_CTYPE hackery, so we don't affect unrelated subprocesses.
- bup_lc_all = environ.get(b'BUP_LC_ALL')
- if bup_lc_all:
- del environ[b'LC_COLLATE']
- del environ[b'LC_CTYPE']
- del environ[b'LC_MONETARY']
- del environ[b'LC_NUMERIC']
- del environ[b'LC_TIME']
- del environ[b'LC_MESSAGES']
- del environ[b'LC_MESSAGES']
- environ[b'LC_ALL'] = bup_lc_all
- return
- bup_lc_ctype = environ.get(b'BUP_LC_CTYPE')
- if bup_lc_ctype:
- environ[b'LC_CTYPE'] = bup_lc_ctype
-
def wrap_main(main):
"""Run main() and raise a SystemExit with the return value if it
returns, pass along any SystemExit it raises, convert
def path_msg(x):
- """Return a string representation of a path.
-
- For now, assume that the destination encoding is going to be
- ISO-8859-1, which it should be, for the primary current
- destination, stderr, given the current bup-python.
-
- """
+ """Return a string representation of a path."""
# FIXME: configurability (might git-config quotePath be involved?)
- return x.decode(encoding='iso-8859-1')
+ return x.decode(errors='backslashreplace')
if classification:
cls = xstat.classification_str(vfs.item_mode(item),
classification == 'all')
- result += cls.encode('iso-8859-1')
+ result += cls.encode('ascii')
return result
from __future__ import absolute_import
-import os
-
+import os, sys
# Eventually, if we physically move the source tree cmd/ to lib/, then
# we could use realpath here and save some stats...
-_libdir = os.path.abspath(os.path.dirname(__file__.encode('iso-8859-1')) + b'/..')
+fsencode = os.fsencode if sys.version_info[0] >= 3 else lambda x: x
+
+_libdir = os.path.abspath(os.path.dirname(fsencode(__file__)) + b'/..')
_resdir = _libdir
_exedir = os.path.abspath(_libdir + b'/cmd')
_exe = os.path.join(_exedir, b'bup')
from __future__ import absolute_import
from time import tzset
-import helpers, math, os, os.path, re, subprocess
+import helpers, math, os, re, subprocess
from wvtest import *
from __future__ import absolute_import
import glob, os, sys, tempfile
+sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
+
from bup import compat, options, git, bloom
from bup.compat import argv_bytes, hexstr
from bup.helpers import (add_error, debug1, handle_ctrl_c, log, progress, qprogress,
# end of bup preamble
from __future__ import absolute_import, print_function
+
+import os, sys
+sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
+
import errno, getopt, os, re, select, signal, subprocess, sys
from subprocess import PIPE
-from bup.compat import environ, restore_lc_env
+from bup.compat import environ, fsdecode
from bup.io import path_msg
if sys.version_info[0] != 2 \
file=sys.stderr)
sys.exit(2)
-restore_lc_env()
-
from bup import compat, path, helpers
from bup.compat import add_ex_tb, add_ex_ctx, argv_bytes, wrap_main
from bup.helpers import atoi, columnate, debug1, log, merge_dict, tty_width
cmds = []
for c in sorted(os.listdir(cmdpath)):
if c.startswith(b'bup-') and c.find(b'.') < 0:
- cname = c[4:].decode('iso-8859-1')
+ cname = fsdecode(c[4:])
if cname not in common:
cmds.append(c[4:].decode(errors='backslashreplace'))
log(columnate(cmds, ' '))
# end of bup preamble
from __future__ import absolute_import
-import re, stat, sys
+import os.path, re, stat, sys
+
+sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
from bup import compat, options, git, vfs
from bup.compat import argv_bytes
# end of bup preamble
from __future__ import absolute_import
-import sys, getopt, socket, subprocess, fcntl
+import os, sys, getopt, socket, subprocess, fcntl
+
+sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
from bup import compat, options, path
from bup.helpers import *
# end of bup preamble
from __future__ import absolute_import
-import sys, os, random
+import os, random, sys
+
+sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
from bup import compat, options
from bup.compat import argv_bytes, bytes_from_uint, range
from __future__ import absolute_import, print_function
from os.path import relpath
-import sys
+import os.path, sys
+
+sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
from bup import compat, options, drecurse
from bup.compat import argv_bytes
# end of bup preamble
from __future__ import absolute_import, print_function
-import sys, os, glob, subprocess
+import os, glob, subprocess, sys
from shutil import rmtree
from subprocess import PIPE, Popen
from tempfile import mkdtemp
from binascii import hexlify
+sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
+
from bup import compat, options, git
from bup.compat import argv_bytes
from bup.helpers import Sha1, chunkyreader, istty2, log, progress
# (e.g. ISO-8859-1).
from __future__ import absolute_import, print_function
-import sys, os, stat, fnmatch
+import os, fnmatch, stat, sys
+
+sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
from bup import _helpers, compat, options, git, shquote, ls, vfs
from bup.compat import argv_bytes
# end of bup preamble
from __future__ import absolute_import, print_function
-import sys, os, errno
+import errno, os, sys
try:
import fuse
file=sys.stderr)
sys.exit(2)
+sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
+
from bup import compat, options, git, vfs, xstat
from bup.compat import argv_bytes, fsdecode, py_maj
from bup.helpers import log
# end of bup preamble
from __future__ import absolute_import
-import sys
+import os.path, sys
+
+sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
from bup import compat, git, options
from bup.gc import bup_gc
from functools import partial
from stat import S_ISDIR
+sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
+
from bup import compat, git, client, helpers, vfs
from bup.compat import argv_bytes, environ, hexstr, items, wrap_main
from bup.git import get_cat_data, parse_commit, walk_object
# end of bup preamble
from __future__ import absolute_import
-import sys, os, glob
+import os, glob, sys
+
+sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
+
from bup import compat, options, path
+
optspec = """
bup help <command>
"""
from subprocess import check_call
from time import strftime, strptime
import os
+import os.path
import sys
import tempfile
+sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
+
from bup import compat, git, helpers, options
from bup.compat import argv_bytes, str_type
from bup.helpers import (handle_ctrl_c,
"""
def logcmd(cmd):
- log(shstr(cmd).decode('iso-8859-1', errors='replace') + '\n')
+ log(shstr(cmd).decode(errors='backslashreplace') + '\n')
def exc(cmd, shell=False):
global opt
from __future__ import absolute_import, print_function
from binascii import hexlify
-import sys, stat, time, os, errno, re
+import errno, os, re, stat, sys, time
+
+sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
from bup import compat, metadata, options, git, index, drecurse, hlinkdb
from bup.compat import argv_bytes
# end of bup preamble
from __future__ import absolute_import
-import sys
+import os.path, sys
+
+sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
from bup import compat, git, options, client
from bup.helpers import log, saved_errors
# end of bup preamble
from __future__ import absolute_import
-import sys
+import os.path, sys
+
+sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
from bup import compat, git, options
from bup.compat import argv_bytes
from __future__ import absolute_import, print_function
from binascii import hexlify, unhexlify
-import sys, os
+import os, sys
+
+sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
from bup import compat, git, options
from bup.compat import argv_bytes
# end of bup preamble
from __future__ import absolute_import
-import sys
+import os.path, sys
+
+sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
from bup import compat, git, ls
from bup.io import byte_stream
# end of bup preamble
from __future__ import absolute_import
-import sys, struct, math
+import math, os.path, struct, sys
+
+sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
from bup import compat, options, git, _helpers
from bup.helpers import log
# end of bup preamble
from __future__ import absolute_import, print_function
-import sys, re, struct, time, resource
+import os.path, re, resource, struct, sys, time
+
+sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
from bup import compat, git, bloom, midx, options, _helpers
from bup.compat import range
# TODO: Add tar-like -C option.
from __future__ import absolute_import
-import sys
+import os, sys
+
+sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
+
from bup import compat, metadata
from bup import options
from bup.compat import argv_bytes
from binascii import hexlify
import glob, math, os, resource, struct, sys, tempfile
+sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
+
from bup import compat, options, git, midx, _helpers, xstat
from bup.compat import argv_bytes, hexstr, range
from bup.helpers import (Sha1, add_error, atomically_replaced_file, debug1, fdatasync,
# end of bup preamble
from __future__ import absolute_import
-import os, sys, subprocess, struct
+import os, struct, subprocess, sys
+
+sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
from bup import compat, options
from bup.helpers import debug1, debug2, mux
# end of bup preamble
from __future__ import absolute_import
-import sys, os, struct
+import os, struct, sys
+
+sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
from bup import compat, options, helpers, path
from bup.compat import environ, py_maj
from __future__ import absolute_import
from subprocess import PIPE
-import sys, os, struct, getopt, subprocess, signal
+import getopt, os, signal, struct, subprocess, sys
+
+sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
from bup import compat, options, ssh, path
from bup.compat import argv_bytes
from itertools import groupby
from sys import stderr
from time import localtime, strftime, time
-import re, sys
+import os.path, re, sys
+
+sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
from bup import compat, git, options
from bup.compat import argv_bytes, int_types
+++ /dev/null
-#!/bin/sh
-
-set -e
-
-top="$(pwd)"
-cmdpath="$0"
-# loop because macos has no recursive resolution
-while test -L "$cmdpath"; do
- link="$(readlink "$cmdpath")"
- cd "$(dirname "$cmdpath")"
- cmdpath="$link"
-done
-script_home="$(cd "$(dirname "$cmdpath")" && pwd -P)"
-cd "$top"
-
-bup_libdir="$script_home/.." # bup_libdir will be adjusted during install
-export PYTHONPATH="$bup_libdir${PYTHONPATH:+:$PYTHONPATH}"
-
-# Force python to use ISO-8859-1 (aka Latin 1), a single-byte
-# encoding, to help avoid any manipulation of data from system APIs
-# (paths, users, groups, command line arguments, etc.)
-
-export PYTHONCOERCECLOCALE=0 # Perhaps not necessary, but shouldn't hurt
-
-# We can't just export LC_CTYPE directly here because the locale might
-# not exist outside python, and then bash (at least) may be cranky.
-
-if [ "${LC_ALL+x}" ]; then
- unset LC_ALL
- exec env \
- BUP_LC_ALL="$LC_ALL" \
- LC_COLLATE="$LC_ALL" \
- LC_MONETARY="$LC_ALL" \
- LC_NUMERIC="$LC_ALL" \
- LC_TIME="$LC_ALL" \
- LC_MESSAGES="$LC_ALL" \
- LC_CTYPE=ISO-8859-1 \
- @bup_python@ "$@"
-elif [ "${LC_CTYPE+x}" ]; then
- exec env \
- BUP_LC_CTYPE="$LC_CTYPE" \
- LC_CTYPE=ISO-8859-1 \
- @bup_python@ "$@"
-else
- exec env \
- LC_CTYPE=ISO-8859-1 \
- @bup_python@ "$@"
-fi
from __future__ import absolute_import
import os, sys
+sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
+
from bup import compat, options, _helpers
from bup.helpers import atoi, handle_ctrl_c, log, parse_num
from __future__ import absolute_import
from stat import S_ISDIR
-import copy, errno, os, sys, stat, re
+import copy, errno, os, re, stat, sys
+
+sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
from bup import compat, options, git, metadata, vfs
from bup._helpers import write_sparsely
# end of bup preamble
from __future__ import absolute_import
-import sys
+import os.path, sys
+
+sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
from bup import compat
from bup.compat import argv_bytes
from binascii import hexlify
from errno import EACCES
from io import BytesIO
-import os, sys, stat, time, math
+import math, os, stat, sys, time
+
+sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
from bup import compat, hashsplit, git, options, index, client, metadata
from bup import hlinkdb
from __future__ import absolute_import
from binascii import hexlify, unhexlify
-import os, sys, struct, subprocess
+import os, struct, subprocess, sys
+
+sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
from bup import compat, options, git, vfs, vint
from bup.compat import environ, hexstr
from binascii import hexlify
import os, sys, time
+sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
+
from bup import compat, hashsplit, git, options, client
from bup.compat import argv_bytes, environ
from bup.helpers import (add_error, handle_ctrl_c, hostname, log, parse_num,
from binascii import hexlify
import os, sys
+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
# end of bup preamble
from __future__ import absolute_import
-import sys, time
+import os, sys, time
+
+sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
from bup import compat, options
+
optspec = """
bup tick
"""
# end of bup preamble
from __future__ import absolute_import, print_function
-import re, sys
+import os.path, re, sys
+
+sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
from bup import compat, options, version
import mimetypes, os, posixpath, signal, stat, sys, time, urllib, webbrowser
from binascii import hexlify
+sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
+
from bup import compat, options, git, vfs
from bup.helpers import (chunkyreader, debug1, format_filesize, handle_ctrl_c,
log, saved_errors)
# Public License as described in the bup LICENSE file.
from __future__ import absolute_import, print_function
-import sys, stat, errno
+import errno, os.path, sys, stat
+
+sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
from bup import compat, metadata, options, xstat
from bup.compat import argv_bytes
for arg in compat.argvb:
os.write(stdout.fileno(), arg)
os.write(stdout.fileno(), b'\0\n')
+ stdout.flush()
from __future__ import absolute_import, print_function
import os, stat, sys
+sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/../lib']
+
from bup import compat
from bup.io import byte_stream
# end of bup preamble
from __future__ import absolute_import
-import os, sys
+import os.path, sys
+
+sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/../lib']
from bup.compat import argv_bytes
from bup.helpers import handle_ctrl_c, saved_errors
from __future__ import absolute_import, print_function
from random import randint
from sys import stderr, stdout
-import sys
+import os, sys
+
+sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/../lib']
from bup.io import byte_stream
# end of bup preamble
from __future__ import absolute_import, print_function
-import sys
+import os.path, sys
+
+sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/../lib']
from bup.compat import argv_bytes
from bup.helpers import handle_ctrl_c, readpipe
# For buptest, wvtest, ...
sys.path[:0] = (abspath(os.path.dirname(__file__) + '/..'),)
+sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/../lib']
from buptest import ex, exo, logcmd, test_tempdir
from wvtest import wvfail, wvpass, wvpasseq, wvpassne, wvstart
# For buptest, wvtest, ...
sys.path[:0] = (abspath(os.path.dirname(__file__) + '/..'),)
+sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/../lib']
+
from bup import compat, path
from bup.compat import environ, getcwd, items
# the 'a-zA-Z0-9_' is '\w' from python,
# the trailing _ is because there's no dir specified
# and that should thus be empty
-hostname=$(bup python -c "from bup import helpers ; print(helpers.hostname().decode('iso8859-1'))")
+hostname=$(uname -n)
idxcache=$(echo "$hostname" | sed 's/[^@a-zA-Z0-9_]/_/g')_
# there should be an index-cache now
for idx in "$tmpdir"/bup/objects/pack/*.idx ; do
# For buptest, wvtest, ...
sys.path[:0] = (abspath(os.path.dirname(__file__) + '/..'),)
+sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/../lib']
from buptest import ex, exo, test_tempdir
from wvtest import wvfail, wvpass, wvpasseq, wvpassne, wvstart
# that gets an error for the .../5 file in metadata.from_path()
cat > "$tmpdir/bup-save" << EOF
#!/usr/bin/env $top/cmd/bup-python
+import os.path, sys
+sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/../../../lib']
from bup import metadata
+
orig_from_path = metadata.from_path
def from_path(path, *args, **kw):
if path.endswith(b'/5'):
cat > "$tmpdir/bup-save" << EOF
#!/usr/bin/env $top/cmd/bup-python
+import os.path, sys
+sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/../../../lib']
from bup import metadata
+
orig_from_path = metadata.from_path
def from_path(path, *args, **kw):
if path.endswith(b'/a'):
cat > "$tmpdir/bup-save" << EOF
#!/usr/bin/env $top/cmd/bup-python
+import os.path, sys
+sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/../../../lib']
from bup import index
Reader = index.Reader