.DEFAULT_GOAL := all
# See config/config.vars.in (sets bup_python, among other things)
-include config/config.vars
+-include config/config.vars
pf := set -o pipefail
+cfg_py := $(CURDIR)/config/bin/python
define isok
&& echo " ok" || echo " no"
initial_setup := $(shell ./configure-version --update $(isok))
initial_setup := $(call shout,$(initial_setup),Version configuration failed))
-config/config.vars: configure config/configure config/configure.inc \
+config/config.vars: \
+ configure config/configure config/configure.inc \
$(wildcard config/*.in)
MAKE="$(MAKE)" ./configure
CFLAGS += $(readline_cflags)
LDFLAGS += $(shell pkg-config readline --libs)
-bup_cmds := cmd/bup-python \
+config/bin/python: config/config.vars
+
+bup_cmds := \
$(patsubst cmd/%-cmd.py,cmd/bup-%,$(wildcard cmd/*-cmd.py)) \
$(patsubst cmd/%-cmd.sh,cmd/bup-%,$(wildcard cmd/*-cmd.sh))
test -z "$(man_html)" || $(INSTALL) -m 0644 $(man_html) $(dest_docdir)
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 \
+ for cmd in $$(ls cmd/bup-*); do \
dev/install-python-script "$$cmd" "$(dest_libdir)/$$cmd"; \
done
cd "$(dest_bindir)" && \
config/config.h lib/bup/bupsplit.h \
lib/bup/bupsplit.c lib/bup/_helpers.c lib/bup/csetup.py
@rm -f $@
- cd lib/bup && $(bup_python) csetup.py build "$(CFLAGS)" "$(LDFLAGS)"
+ cd lib/bup && $(cfg_py) csetup.py build "$(CFLAGS)" "$(LDFLAGS)"
# Make sure there's just the one file we expect before we copy it.
- "$(bup_python)" -c \
+ $(cfg_py) -c \
"import glob; assert(len(glob.glob('lib/bup/build/*/_helpers*$(SOEXT)')) == 1)"
cp lib/bup/build/*/_helpers*$(SOEXT) "$@"
distcheck: all
./wvtest run t/test-release-archive.sh
-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
$(pf); git archive origin/html | (cd Documentation && tar -xvf -)
$(pf); git archive origin/man | (cd Documentation && tar -xvf -)
-clean: Documentation/clean cmd/bup-python
+clean: Documentation/clean config/bin/python
+ cd config && rm -rf config.var
cd config && rm -f *~ .*~ \
${CONFIGURE_DETRITUS} ${CONFIGURE_FILES} ${GENERATED_FILES}
- cd config && rm -rf config.var
rm -f *.o lib/*/*.o *.so lib/*/*.so *.dll lib/*/*.dll *.exe \
.*~ *~ */*~ lib/*/*~ lib/*/*/*~ \
*.pyc */*.pyc lib/*/*.pyc lib/*/*/*.pyc \
./configure-version --clean
t/configure-sampledata --clean
# Remove last so that cleanup tools can depend on it
- rm -f cmd/bup-python
+ rm -rf config/bin
+++ /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 "$@"
--- /dev/null
+lib/cmd/bup
\ No newline at end of file
AC_OUTPUT config.vars
+if test -e config.var; then rm -r config.var; fi
mkdir -p config.var
echo -n "$MAKE" > config.var/bup-make
echo -n "$bup_python" > config.var/bup-python
+
+if test -e bin; then rm -r bin; fi
+mkdir -p bin
+cd bin && ln -s "$bup_python" python
--- /dev/null
+#!/bin/sh
+
+set -e
+
+script_home="$(cd "$(dirname "$0")" && pwd -P)"
+python="$script_home/../config/bin/python"
+libdir="$script_home/../lib"
+
+export PYTHONPATH="$libdir${PYTHONPATH:+:$PYTHONPATH}"
+exec "$python" "$@"
arg_i=$((arg_i + 1))
done
# Here to end of preamble replaced during install
-bup_python="$(dirname "$0")/bup-python" || exit $?
+bup_python="$(dirname "$0")/../../config/bin/python" || exit $?
exec "$bup_python" "$0"
"""
# end of bup preamble
done
script_home="$(cd "$(dirname "$cmdpath")" && pwd -P)"
cd "$top"
-exec "$script_home/bup-python" "$0"
+exec "$script_home/../../config/bin/python" "$0"
"""
# end of bup preamble
arg_i=$((arg_i + 1))
done
# Here to end of preamble replaced during install
-bup_python="$(dirname "$0")/bup-python" || exit $?
+bup_python="$(dirname "$0")/../../config/bin/python" || exit $?
exec "$bup_python" "$0"
"""
# end of bup preamble
arg_i=$((arg_i + 1))
done
# Here to end of preamble replaced during install
-bup_python="$(dirname "$0")/bup-python" || exit $?
+bup_python="$(dirname "$0")/../../config/bin/python" || exit $?
exec "$bup_python" "$0"
"""
# end of bup preamble
arg_i=$((arg_i + 1))
done
# Here to end of preamble replaced during install
-bup_python="$(dirname "$0")/bup-python" || exit $?
+bup_python="$(dirname "$0")/../../config/bin/python" || exit $?
exec "$bup_python" "$0"
"""
# end of bup preamble
arg_i=$((arg_i + 1))
done
# Here to end of preamble replaced during install
-bup_python="$(dirname "$0")/bup-python" || exit $?
+bup_python="$(dirname "$0")/../../config/bin/python" || exit $?
exec "$bup_python" "$0"
"""
# end of bup preamble
arg_i=$((arg_i + 1))
done
# Here to end of preamble replaced during install
-bup_python="$(dirname "$0")/bup-python" || exit $?
+bup_python="$(dirname "$0")/../../config/bin/python" || exit $?
exec "$bup_python" "$0"
"""
# end of bup preamble
arg_i=$((arg_i + 1))
done
# Here to end of preamble replaced during install
-bup_python="$(dirname "$0")/bup-python" || exit $?
+bup_python="$(dirname "$0")/../../config/bin/python" || exit $?
exec "$bup_python" "$0"
"""
# end of bup preamble
arg_i=$((arg_i + 1))
done
# Here to end of preamble replaced during install
-bup_python="$(dirname "$0")/bup-python" || exit $?
+bup_python="$(dirname "$0")/../../config/bin/python" || exit $?
exec "$bup_python" "$0"
"""
# end of bup preamble
arg_i=$((arg_i + 1))
done
# Here to end of preamble replaced during install
-bup_python="$(dirname "$0")/bup-python" || exit $?
+bup_python="$(dirname "$0")/../../config/bin/python" || exit $?
exec "$bup_python" "$0"
"""
# end of bup preamble
arg_i=$((arg_i + 1))
done
# Here to end of preamble replaced during install
-bup_python="$(dirname "$0")/bup-python" || exit $?
+bup_python="$(dirname "$0")/../../config/bin/python" || exit $?
exec "$bup_python" "$0"
"""
# end of bup preamble
arg_i=$((arg_i + 1))
done
# Here to end of preamble replaced during install
-bup_python="$(dirname "$0")/bup-python" || exit $?
+bup_python="$(dirname "$0")/../../config/bin/python" || exit $?
exec "$bup_python" "$0"
"""
# end of bup preamble
arg_i=$((arg_i + 1))
done
# Here to end of preamble replaced during install
-bup_python="$(dirname "$0")/bup-python" || exit $?
+bup_python="$(dirname "$0")/../../config/bin/python" || exit $?
exec "$bup_python" "$0"
"""
# end of bup preamble
arg_i=$((arg_i + 1))
done
# Here to end of preamble replaced during install
-bup_python="$(dirname "$0")/bup-python" || exit $?
+bup_python="$(dirname "$0")/../../config/bin/python" || exit $?
exec "$bup_python" "$0"
"""
# end of bup preamble
arg_i=$((arg_i + 1))
done
# Here to end of preamble replaced during install
-bup_python="$(dirname "$0")/bup-python" || exit $?
+bup_python="$(dirname "$0")/../../config/bin/python" || exit $?
exec "$bup_python" "$0"
"""
# end of bup preamble
arg_i=$((arg_i + 1))
done
# Here to end of preamble replaced during install
-bup_python="$(dirname "$0")/bup-python" || exit $?
+bup_python="$(dirname "$0")/../../config/bin/python" || exit $?
exec "$bup_python" "$0"
"""
# end of bup preamble
arg_i=$((arg_i + 1))
done
# Here to end of preamble replaced during install
-bup_python="$(dirname "$0")/bup-python" || exit $?
+bup_python="$(dirname "$0")/../../config/bin/python" || exit $?
exec "$bup_python" "$0"
"""
# end of bup preamble
arg_i=$((arg_i + 1))
done
# Here to end of preamble replaced during install
-bup_python="$(dirname "$0")/bup-python" || exit $?
+bup_python="$(dirname "$0")/../../config/bin/python" || exit $?
exec "$bup_python" "$0"
"""
# end of bup preamble
arg_i=$((arg_i + 1))
done
# Here to end of preamble replaced during install
-bup_python="$(dirname "$0")/bup-python" || exit $?
+bup_python="$(dirname "$0")/../../config/bin/python" || exit $?
exec "$bup_python" "$0"
"""
# end of bup preamble
arg_i=$((arg_i + 1))
done
# Here to end of preamble replaced during install
-bup_python="$(dirname "$0")/bup-python" || exit $?
+bup_python="$(dirname "$0")/../../config/bin/python" || exit $?
exec "$bup_python" "$0"
"""
# end of bup preamble
arg_i=$((arg_i + 1))
done
# Here to end of preamble replaced during install
-bup_python="$(dirname "$0")/bup-python" || exit $?
+bup_python="$(dirname "$0")/../../config/bin/python" || exit $?
exec "$bup_python" "$0"
"""
# end of bup preamble
arg_i=$((arg_i + 1))
done
# Here to end of preamble replaced during install
-bup_python="$(dirname "$0")/bup-python" || exit $?
+bup_python="$(dirname "$0")/../../config/bin/python" || exit $?
exec "$bup_python" "$0"
"""
# end of bup preamble
arg_i=$((arg_i + 1))
done
# Here to end of preamble replaced during install
-bup_python="$(dirname "$0")/bup-python" || exit $?
+bup_python="$(dirname "$0")/../../config/bin/python" || exit $?
exec "$bup_python" "$0"
"""
# end of bup preamble
arg_i=$((arg_i + 1))
done
# Here to end of preamble replaced during install
-bup_python="$(dirname "$0")/bup-python" || exit $?
+bup_python="$(dirname "$0")/../../config/bin/python" || exit $?
exec "$bup_python" "$0"
"""
# end of bup preamble
arg_i=$((arg_i + 1))
done
# Here to end of preamble replaced during install
-bup_python="$(dirname "$0")/bup-python" || exit $?
+bup_python="$(dirname "$0")/../../config/bin/python" || exit $?
exec "$bup_python" "$0"
"""
# end of bup preamble
arg_i=$((arg_i + 1))
done
# Here to end of preamble replaced during install
-bup_python="$(dirname "$0")/bup-python" || exit $?
+bup_python="$(dirname "$0")/../../config/bin/python" || exit $?
exec "$bup_python" "$0"
"""
# end of bup preamble
arg_i=$((arg_i + 1))
done
# Here to end of preamble replaced during install
-bup_python="$(dirname "$0")/bup-python" || exit $?
+bup_python="$(dirname "$0")/../../config/bin/python" || exit $?
exec "$bup_python" "$0"
"""
# end of bup preamble
arg_i=$((arg_i + 1))
done
# Here to end of preamble replaced during install
-bup_python="$(dirname "$0")/bup-python" || exit $?
+bup_python="$(dirname "$0")/../../config/bin/python" || exit $?
exec "$bup_python" "$0"
"""
# end of bup preamble
arg_i=$((arg_i + 1))
done
# Here to end of preamble replaced during install
-bup_python="$(dirname "$0")/bup-python" || exit $?
+bup_python="$(dirname "$0")/../../config/bin/python" || exit $?
exec "$bup_python" "$0"
"""
# end of bup preamble
arg_i=$((arg_i + 1))
done
# Here to end of preamble replaced during install
-bup_python="$(dirname "$0")/bup-python" || exit $?
+bup_python="$(dirname "$0")/../../config/bin/python" || exit $?
exec "$bup_python" "$0"
"""
# end of bup preamble
arg_i=$((arg_i + 1))
done
# Here to end of preamble replaced during install
-bup_python="$(dirname "$0")/bup-python" || exit $?
+bup_python="$(dirname "$0")/../../config/bin/python" || exit $?
exec "$bup_python" "$0"
"""
# end of bup preamble
arg_i=$((arg_i + 1))
done
# Here to end of preamble replaced during install
-bup_python="$(dirname "$0")/bup-python" || exit $?
+bup_python="$(dirname "$0")/../../config/bin/python" || exit $?
exec "$bup_python" "$0"
"""
# end of bup preamble
arg_i=$((arg_i + 1))
done
# Here to end of preamble replaced during install
-bup_python="$(dirname "$0")/bup-python" || exit $?
+bup_python="$(dirname "$0")/../../config/bin/python" || exit $?
exec "$bup_python" "$0"
"""
# end of bup preamble
arg_i=$((arg_i + 1))
done
# Here to end of preamble replaced during install
-bup_python="$(dirname "$0")/bup-python" || exit $?
+bup_python="$(dirname "$0")/../../config/bin/python" || exit $?
exec "$bup_python" "$0"
"""
# end of bup preamble
arg_i=$((arg_i + 1))
done
# Here to end of preamble replaced during install
-bup_python="$(dirname "$0")/bup-python" || exit $?
+bup_python="$(dirname "$0")/../../config/bin/python" || exit $?
exec "$bup_python" "$0"
"""
# end of bup preamble
arg_i=$((arg_i + 1))
done
# Here to end of preamble replaced during install
-bup_python="$(dirname "$0")/bup-python" || exit $?
+bup_python="$(dirname "$0")/../../config/bin/python" || exit $?
exec "$bup_python" "$0"
"""
# end of bup preamble
arg_i=$((arg_i + 1))
done
# Here to end of preamble replaced during install
-bup_python="$(dirname "$0")/bup-python" || exit $?
+bup_python="$(dirname "$0")/../../config/bin/python" || exit $?
exec "$bup_python" "$0"
"""
# end of bup preamble
#!/bin/sh
"""": # -*-python-*-
-bup_python="$(dirname "$0")/../cmd/bup-python" || exit $?
+bup_python="$(dirname "$0")/../config/bin/python" || exit $?
exec "$bup_python" "$0" ${1+"$@"}
"""
#!/bin/sh
"""": # -*-python-*-
-bup_python="$(dirname "$0")/../cmd/bup-python" || exit $?
+bup_python="$(dirname "$0")/../config/bin/python" || exit $?
exec "$bup_python" "$0" ${1+"$@"}
"""
# end of bup preamble
shift
arg_i=$((arg_i + 1))
done
-bup_python="$(dirname "$0")/../lib/cmd/bup-python" || exit $?
+bup_python="$(dirname "$0")/../dev/bup-python" || exit $?
exec "$bup_python" "$0"
"""
# end of bup preamble
shift
arg_i=$((arg_i + 1))
done
-bup_python="$(dirname "$0")/../lib/cmd/bup-python" || exit $?
+bup_python="$(dirname "$0")/../dev/bup-python" || exit $?
exec "$bup_python" "$0"
"""
# end of bup preamble
#!/bin/sh
"""": # -*-python-*-
-bup_python="$(dirname "$0")/../cmd/bup-python" || exit $?
+bup_python="$(dirname "$0")/../config/bin/python" || exit $?
exec "$bup_python" "$0" ${1+"$@"}
"""
# end of bup preamble
bup_t_lib_script_home=$(cd "$(dirname $0)" && pwd) || exit $?
-bup-python()
-{
- "$bup_t_lib_script_home/../cmd/bup-python" "$@"
-}
+bup-cfg-py() { "$bup_t_lib_script_home/../config/bin/python" "$@"; }
+bup-python() { "$bup_t_lib_script_home/../dev/bup-python" "$@"; }
force-delete()
{
#!/bin/sh
"""": # -*-python-*-
-bup_python="$(dirname "$0")/../cmd/bup-python" || exit $?
+bup_python="$(dirname "$0")/../dev/bup-python" || exit $?
exec "$bup_python" "$0" ${1+"$@"}
"""
# end of bup preamble
#!/bin/sh
"""": # -*-python-*-
-bup_python="$(dirname "$0")/../cmd/bup-python" || exit $?
+bup_python="$(dirname "$0")/../config/bin/python" || exit $?
exec "$bup_python" "$0" ${1+"$@"}
"""
# end of bup preamble
shift
arg_i=$((arg_i + 1))
done
-bup_python="$(dirname "$0")/../lib/cmd/bup-python" || exit $?
+bup_python="$(dirname "$0")/../dev/bup-python" || exit $?
exec "$bup_python" "$0"
"""
# end of bup preamble
#!/bin/sh
"""": # -*-python-*-
-bup_python="$(dirname "$0")/../cmd/bup-python" || exit $?
+bup_python="$(dirname "$0")/../config/bin/python" || exit $?
exec "$bup_python" "$0" ${1+"$@"}
"""
# end of bup preamble
#!/bin/sh
"""": # -*-python-*-
-bup_python="$(dirname "$0")/../cmd/bup-python" || exit $?
+bup_python="$(dirname "$0")/../dev/bup-python" || exit $?
exec "$bup_python" "$0" ${1+"$@"}
"""
#!/bin/sh
"""": # -*-python-*-
-bup_python="$(dirname "$0")/../cmd/bup-python" || exit $?
+bup_python="$(dirname "$0")/../dev/bup-python" || exit $?
exec "$bup_python" "$0" ${1+"$@"}
"""
# end of bup preamble
#!/bin/sh
"""": # -*-python-*-
-bup_python="$(dirname "$0")/../cmd/bup-python" || exit $?
+bup_python="$(dirname "$0")/../config/bin/python" || exit $?
exec "$bup_python" "$0" ${1+"$@"}
"""
# end of bup preamble
#!/bin/sh
"""": # -*-python-*-
-bup_python="$(dirname "$0")/../cmd/bup-python" || exit $?
+bup_python="$(dirname "$0")/../dev/bup-python" || exit $?
exec "$bup_python" "$0" ${1+"$@"}
"""
# end of bup preamble
savename()
{
readonly secs="$1"
- WVPASS bup-python -c "from time import strftime, localtime; \
+ WVPASS bup-cfg-py -c "from time import strftime, localtime; \
print(strftime('%Y-%m-%d-%H%M%S', localtime($secs)))"
}
WVPASS bup init
WVPASS cd "$tmpdir"
-savestamp1=$(WVPASS bup-python -c 'import time; print(int(time.time()))') || exit $?
+savestamp1=$(WVPASS bup-cfg-py -c 'import time; print(int(time.time()))') || exit $?
savestamp2=$(($savestamp1 + 1))
savename1="$(savename "$savestamp1")" || exit $?
shift
arg_i=$((arg_i + 1))
done
-bup_python="$(dirname "$0")/../lib/cmd/bup-python" || exit $?
+bup_python="$(dirname "$0")/../dev/bup-python" || exit $?
exec "$bup_python" "$0"
"""
# end of bup preamble
WVPASS bup tag some-tag src
uid="$(WVPASS id -u)" || exit $?
-gid="$(WVPASS bup-python -c 'import os; print(os.stat("src").st_gid)')" || exit $?
+gid="$(WVPASS bup-cfg-py -c 'import os; print(os.stat("src").st_gid)')" || exit $?
user="$(WVPASS id -un)" || exit $?
-group="$(WVPASS bup-python -c 'import grp, os;
+group="$(WVPASS bup-cfg-py -c 'import grp, os;
print(grp.getgrgid(os.stat("src").st_gid)[0])')" || exit $?
src_commit_hash=$(git log --format=%H -n1 src)
src_tree_hash=$(git log --format=%T -n1 src)
test "$bad_symlink_date" || exit 1
if test "$(uname -s)" != NetBSD; then
- bad_symlink_size="$(WVPASS bup-python -c "import os
+ bad_symlink_size="$(WVPASS bup-cfg-py -c "import os
print(os.lstat('src/bad-symlink').st_size)")" || exit $?
else
# NetBSD appears to return varying sizes, so for now, just ignore it.
test "$symlink_date" || exit 1
if test "$(uname -s)" != NetBSD; then
- symlink_size="$(WVPASS bup-python -c "import os
+ symlink_size="$(WVPASS bup-cfg-py -c "import os
print(os.lstat('src/symlink').st_size)")" || exit $?
else
# NetBSD appears to return varying sizes, so for now, just ignore it.
genstat()
{
(
- export PATH="$TOP:$PATH" # pick up bup
+ export PATH="$TOP/bin:$PATH" # pick up bup
+ bup version
# Skip atime (test elsewhere) to avoid the observer effect.
WVPASS find . -print0 | WVPASS sort -z \
| WVPASS xargs -0 bup xstat \
tmpdir="$(WVPASS wvmktempdir)" || exit $?
# FIXME: binary groups
- first_group="$(WVPASS bup-python -c 'import os,grp; \
+ first_group="$(WVPASS bup-cfg-py -c 'import os,grp; \
print(grp.getgrgid(os.getgroups()[0])[0])')" || exit $?
- last_group="$(bup-python -c 'import os,grp; \
+ last_group="$(bup-cfg-py -c 'import os,grp; \
print(grp.getgrgid(os.getgroups()[-1])[0])')" || exit $?
last_group_erx="$(escape-erx "$last_group")"
WVPASS cd "$testfs_limited"/src-restore
WVFAIL bup meta --extract --file "$testfs"/src.meta 2>&1 \
| WVPASS grep -e '^Linux chattr:' \
- | WVPASS bup-python -c \
+ | WVPASS bup-cfg-py -c \
'import sys; exit(not len(sys.stdin.readlines()) == 3)'
) || exit $?
) || exit $?
WVFAIL bup meta --extract --file "$testfs"/src.meta
WVFAIL bup meta --extract --file "$testfs"/src.meta 2>&1 \
| WVPASS grep -e "^xattr\.set u\?'" \
- | WVPASS bup-python -c \
+ | WVPASS bup-cfg-py -c \
'import sys; exit(not len(sys.stdin.readlines()) == 2)'
) || exit $?
WVPASS cd "$testfs_limited"/src-restore
WVFAIL bup meta --extract --file "$testfs"/src.meta 2>&1 \
| WVPASS grep -e '^POSIX1e ACL applyto:' \
- | WVPASS bup-python -c \
+ | WVPASS bup-cfg-py -c \
'import sys; exit(not len(sys.stdin.readlines()) == 2)'
) || exit $?
#!/bin/sh
"""": # -*-python-*-
-bup_python="$(dirname "$0")/../cmd/bup-python" || exit $?
+bup_python="$(dirname "$0")/../dev/bup-python" || exit $?
exec "$bup_python" "$0" ${1+"$@"}
"""
# end of bup preamble
WVPASS grep -qE "^group: $other_group\$" foo-xstat
WVPASS grep -qE "^gid: $other_gid\$" foo-xstat
-has_uid_gid_0=$(WVPASS bup-python -c "
+has_uid_gid_0=$(WVPASS bup-cfg-py -c "
import grp, pwd
try:
pwd.getpwuid(0)
# 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
-#!/usr/bin/env $top/cmd/bup-python
-import os.path, sys
-sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/../../../lib']
+#!/usr/bin/env $top/dev/bup-python
from bup import metadata
orig_from_path = metadata.from_path
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
-#!/usr/bin/env $top/cmd/bup-python
-import os.path, sys
-sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/../../../lib']
+#!/usr/bin/env $top/dev/bup-python
from bup import metadata
orig_from_path = metadata.from_path
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
-#!/usr/bin/env $top/cmd/bup-python
-import os.path, sys
-sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/../../../lib']
+#!/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"
# The 3MB guess is semi-arbitrary, but we've been informed that
# Lustre, for example, uses 1MB, so guess higher than that, at least.
-block_size=$(bup-python -c \
+block_size=$(bup-cfg-py -c \
"import os; print(getattr(os.stat('.'), 'st_blksize', 0)) or $mb * 3") \
|| exit $?
data_size=$((block_size * 10))
WVPASS "$top/t/compare-trees" -c src/ restore/src/
WVSTART "sparse file restore --sparse (short zero runs around boundary)"
-WVPASS bup-python > src/foo <<EOF
+WVPASS bup-cfg-py > src/foo <<EOF
from sys import stdout
stdout.write("x" * 65535 + "\0")
stdout.write("\0" + "x" * 65535)
exit 0
fi
-WVPASS bup-python -c "import socket as s; s.socket(s.AF_UNIX).bind('socket')"
+WVPASS bup-cfg-py -c "import socket as s; s.socket(s.AF_UNIX).bind('socket')"
curl -s --unix-socket ./socket http://localhost/foo
if test $? -ne 7; then
WVSTART 'curl does not appear to support --unix-socket; skipping test'
#!/bin/sh
"""": # -*-python-*-
-bup_python="$(dirname "$0")/../cmd/bup-python" || exit $?
+bup_python="$(dirname "$0")/../config/bin/python" || exit $?
exec "$bup_python" "$0" ${1+"$@"}
"""
# end of bup preamble
#!/bin/sh
"""": # -*-python-*-
-bup_python="$(dirname "$0")/cmd/bup-python"
+bup_python="$(dirname "$0")/dev/bup-python"
exec "$bup_python" "$0" ${1+"$@"}
"""
# end of bup preamble