]> arthur.barton.de Git - bup.git/commitdiff
Split src tree python use to config/bin/python and dev/bup-python
authorRob Browning <rlb@defaultvalue.org>
Sat, 30 May 2020 02:50:25 +0000 (21:50 -0500)
committerRob Browning <rlb@defaultvalue.org>
Sun, 5 Jul 2020 16:16:22 +0000 (11:16 -0500)
Replace cmd/bup-python with config/bin/python, which is just a symlink
to the configured python, and dev/bup-python, which is what "bup
python" used to be.  Adjust all the code to use config/bin/python when
we can (i.e. when we don't need bup modules), and dev/bup-python
otherwise.  Drop "bup python", since we don't need it anymore.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
66 files changed:
Makefile
bup [changed from file to symlink]
config/configure
dev/bup-python [new file with mode: 0755]
lib/cmd/bloom-cmd.py
lib/cmd/bup
lib/cmd/cat-file-cmd.py
lib/cmd/daemon-cmd.py
lib/cmd/damage-cmd.py
lib/cmd/drecurse-cmd.py
lib/cmd/fsck-cmd.py
lib/cmd/ftp-cmd.py
lib/cmd/fuse-cmd.py
lib/cmd/gc-cmd.py
lib/cmd/get-cmd.py
lib/cmd/help-cmd.py
lib/cmd/import-duplicity-cmd.py
lib/cmd/index-cmd.py
lib/cmd/init-cmd.py
lib/cmd/join-cmd.py
lib/cmd/list-idx-cmd.py
lib/cmd/ls-cmd.py
lib/cmd/margin-cmd.py
lib/cmd/memtest-cmd.py
lib/cmd/meta-cmd.py
lib/cmd/midx-cmd.py
lib/cmd/mux-cmd.py
lib/cmd/on--server-cmd.py
lib/cmd/on-cmd.py
lib/cmd/prune-older-cmd.py
lib/cmd/random-cmd.py
lib/cmd/restore-cmd.py
lib/cmd/rm-cmd.py
lib/cmd/save-cmd.py
lib/cmd/server-cmd.py
lib/cmd/split-cmd.py
lib/cmd/tag-cmd.py
lib/cmd/tick-cmd.py
lib/cmd/version-cmd.py
lib/cmd/web-cmd.py
lib/cmd/xstat-cmd.py
t/cleanup-mounts-under
t/data-size
t/echo-argv-bytes
t/hardlink-sets
t/id-other-than
t/lib.sh
t/make-random-paths
t/mksock
t/ns-timestamp-resolutions
t/root-status
t/sparse-test-data
t/subtree-hash
t/test-argv
t/test-ftp
t/test-fuse.sh
t/test-get
t/test-ls
t/test-meta.sh
t/test-prune-older
t/test-restore-map-owner.sh
t/test-save-errors
t/test-sparse-files.sh
t/test-web.sh
t/unknown-owner
wvtest.py

index 86c973ce5bf0eb57674ccf3caf77dbe515e1bf41..4ca1a031c7c2a3daf362849a782e7f364e5a7ce7 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -3,9 +3,10 @@ SHELL := bash
 .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"
@@ -42,7 +43,8 @@ endif
 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
 
@@ -61,7 +63,9 @@ readline_cflags += $(addprefix -DBUP_RL_EXPECTED_XOPEN_SOURCE=,$(readline_xopen)
 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))
 
@@ -106,7 +110,7 @@ install: all
        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)" && \
@@ -131,9 +135,9 @@ lib/bup/_helpers$(SOEXT): \
                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) "$@"
 
@@ -253,9 +257,6 @@ check: test
 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
 
@@ -311,10 +312,10 @@ import-docs: Documentation/clean
        $(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 \
@@ -334,4 +335,4 @@ clean: Documentation/clean cmd/bup-python
        ./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
diff --git a/bup b/bup
deleted file mode 100755 (executable)
index 0d15289694846be294784ae4a63c42dfbfae9e64..0000000000000000000000000000000000000000
--- a/bup
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/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 "$@"
diff --git a/bup b/bup
new file mode 120000 (symlink)
index 0000000000000000000000000000000000000000..e1c0ca8fe3c485d86ebd7ea8efda66974ccfb873
--- /dev/null
+++ b/bup
@@ -0,0 +1 @@
+lib/cmd/bup
\ No newline at end of file
index 3eab5d3b8281cbcecdd3a34df928810101c1202f..6dacf8be34d61bc41f4a6a5509c717558cef6521 100755 (executable)
@@ -186,6 +186,11 @@ AC_CHECK_FIELD tm tm_gmtoff time.h
 
 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
diff --git a/dev/bup-python b/dev/bup-python
new file mode 100755 (executable)
index 0000000..384a8fd
--- /dev/null
@@ -0,0 +1,10 @@
+#!/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" "$@"
index fdf8145acb7caaf706446a392e55aa8ad2f7bfb0..850382e5ed5bc07842b4f99f898e8b6700d49e3c 100755 (executable)
@@ -9,7 +9,7 @@ for arg in "$@"; do
     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
index 5c4504178fcdd86066622c84c29bc4d7afc24a10..a23b595d35141a4fc5d766c08837811b29b5fa7f 100755 (executable)
@@ -21,7 +21,7 @@ while test -L "$cmdpath"; do
 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
 
index 7fbc256ecd3be9478b45c5e78c976bc0ad9fdc8b..388ca03abcbe519e0c84eea7a72fa41378ad42ad 100755 (executable)
@@ -9,7 +9,7 @@ for arg in "$@"; do
     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
index 5506ea10aa9e085ea4294f874b6277be325be6be..ffe79ddade9ea70801fe97a918083e15e7aa871e 100755 (executable)
@@ -9,7 +9,7 @@ for arg in "$@"; do
     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
index c7c712a138bf05a537b314f3776a7dfc60947e9a..85995edf439a4532657aafdc4d455ebea1f93a26 100755 (executable)
@@ -9,7 +9,7 @@ for arg in "$@"; do
     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
index 6cb0fc494adac2a4b602ad03a916db58a3fcbf5e..1c6791832741186238c1151e1b57943805cb1ba1 100755 (executable)
@@ -9,7 +9,7 @@ for arg in "$@"; do
     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
index e5eea329d06e8dd303602c81ad66536b1b3bc9c0..0a1bdb079c401f1ee9cfd33f93dcd58ca7e319c9 100755 (executable)
@@ -9,7 +9,7 @@ for arg in "$@"; do
     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
index 1aada9a10834d902b5ec7743b69c3617b4e2eefe..732082abbbbd1a49e870d10ffc8b7b1257223d14 100755 (executable)
@@ -9,7 +9,7 @@ for arg in "$@"; do
     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
index bb6d98d06f0e86b382f0a1d6f23a508c0aa57ebf..1b8bd9ccb6d2ac494755c1a44884198281b0540b 100755 (executable)
@@ -9,7 +9,7 @@ for arg in "$@"; do
     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
index 7368eca4852666ed3be94c7843822c4aa6e5affd..71e4e75c7dc7bd34b03f5dd91cab3cc49c2850d5 100755 (executable)
@@ -9,7 +9,7 @@ for arg in "$@"; do
     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
index c3198241d3da46ef6fababc1e665e6a6a217b82c..4880cbf7ae66ee79ea33fd65bee657d596bcf0e2 100755 (executable)
@@ -9,7 +9,7 @@ for arg in "$@"; do
     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
index aeacc70dc41420ee30fa03d4df1eae7c8b4af967..0561742adf08c7374b1e65b236e52e317cac72b6 100755 (executable)
@@ -9,7 +9,7 @@ for arg in "$@"; do
     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
index 77b53ebc7cbe3645bf20b1bae1f3c40f4adbcfc0..348be8cbbaa397b9620ca4b1ea3b2e67dd475d16 100755 (executable)
@@ -9,7 +9,7 @@ for arg in "$@"; do
     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
index a47e20888b583e616fc403b6eeb8fe3761a161e4..a479ca9427a7b768ef763aa0cdfe249091d96ace 100755 (executable)
@@ -9,7 +9,7 @@ for arg in "$@"; do
     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
index 13bff7dcce24295d2b28945176113749bca8c85c..b0b039917bc1ee708d2ac676081078df60f77ec5 100755 (executable)
@@ -9,7 +9,7 @@ for arg in "$@"; do
     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
index 55d9eed48d7455243374558efebd6b0e1f92ba50..0cf6ef8f4d3572bc8b9ae2948fadf7d2c4317869 100755 (executable)
@@ -9,7 +9,7 @@ for arg in "$@"; do
     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
index ebafdfac0609b7338944f4815e4e32b804d37a82..e7e7600cdb42a0f38fcd9659bdb2dfacc83921b5 100755 (executable)
@@ -9,7 +9,7 @@ for arg in "$@"; do
     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
index 6cc047bbcdd89668968122e30cb23e535b0dae18..f034c0911f0cc8124c30273f955eedd885f35d9d 100755 (executable)
@@ -9,7 +9,7 @@ for arg in "$@"; do
     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
index 825102b255c907f6824ee883fec157c38eb6bbac..09411bc7778c0d5f643f8f6b520d334088879fcd 100755 (executable)
@@ -9,7 +9,7 @@ for arg in "$@"; do
     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
index 6f4dfd0a564e147a4bff1e253873b20f61e6199f..c5d86778f06e9feafb64d299f8b557cfe06c2511 100755 (executable)
@@ -9,7 +9,7 @@ for arg in "$@"; do
     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
index 15eed439cf82ac1978bf984bb7930c8116943ff2..e9a3d61146f6a665e7abdd4d4b8c957991958ba9 100755 (executable)
@@ -9,7 +9,7 @@ for arg in "$@"; do
     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
index b5ed7c47a6146d6a054543b3bada8c9c65c482f4..35e2bc2d5044021d2ec5ab892a338d3382a65810 100755 (executable)
@@ -9,7 +9,7 @@ for arg in "$@"; do
     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
index 1050262ff3ee9c44a1f192ab4b968666dfc84c79..a3b4d57a512cdc7f6114711f17234d1eb7ca3a11 100755 (executable)
@@ -9,7 +9,7 @@ for arg in "$@"; do
     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
index 12fee0855c3f7bbb5022c22bda2fe63678e4034f..0c151b0f1655229094cc2723b9eac3fed45cc84f 100755 (executable)
@@ -9,7 +9,7 @@ for arg in "$@"; do
     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
index 0644a46a4e6cdc58abd1c3d6216ffd940eb8dec1..9eaabef2eaa833a5d854d754ef3b4cb5b00b4fa4 100755 (executable)
@@ -9,7 +9,7 @@ for arg in "$@"; do
     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
index 07bf7daf341fab42696c4de2131842f31f3fa7dc..c25bb81f74c20fff482e5efffe0fe2d05932c343 100755 (executable)
@@ -9,7 +9,7 @@ for arg in "$@"; do
     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
index 086dfff382bba2f12ddcfd5ce86e85954989657a..1dd1ff3f720976d7a984c62908fb6f9f681df9df 100755 (executable)
@@ -9,7 +9,7 @@ for arg in "$@"; do
     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
index 43071d1f0568a0dc0016f80e086887ccbe2f2cdf..7c8ca262ff3b0d1aba6eddb6049b4ff9493d88ee 100755 (executable)
@@ -9,7 +9,7 @@ for arg in "$@"; do
     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
index 4016c008722392af979bd49f0db1e375546b4e9c..1af1e5959efb7c98024b47960eb2b59e7d1e6fcc 100755 (executable)
@@ -9,7 +9,7 @@ for arg in "$@"; do
     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
index c67e1ed89d61addef236a511ebb468ab3cb1259c..5cdedf65f1c10bdb362802d7cb3f1bb034229271 100755 (executable)
@@ -9,7 +9,7 @@ for arg in "$@"; do
     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
index a81844530aa0e07017fe35518bb4fe1d4472a663..ada92d24dc34dc4dcfc1aa1a45998fcf7c38a251 100755 (executable)
@@ -9,7 +9,7 @@ for arg in "$@"; do
     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
index 6735d70d1afca8a4e06f53baf583b09c6f7db28a..3105eb8290751668ee49bb6a0c4d0339e480cd76 100755 (executable)
@@ -9,7 +9,7 @@ for arg in "$@"; do
     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
index c2b6fae93161a8c5dc57223ecbf424d73f9d75d0..0d52677ad4b59ad9a35722a59690dc24e42e8082 100755 (executable)
@@ -9,7 +9,7 @@ for arg in "$@"; do
     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
index dcafc815d56f789cb6df2b0555ae7ae47ba8dff7..697057e7f714798be34dcf57b5d215822af608fb 100755 (executable)
@@ -9,7 +9,7 @@ for arg in "$@"; do
     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
index 7dcd27988939f65b272cb7dd527c101efcaf193f..f158c91c86f5458fc99111cd900a5cce93172dc7 100755 (executable)
@@ -9,7 +9,7 @@ for arg in "$@"; do
     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
index 7b8b7b6069cd04242f02467671536db4ed17c544..d765463d854df9a5218273e0d53def45c0f47d8b 100755 (executable)
@@ -9,7 +9,7 @@ for arg in "$@"; do
     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
index 8a56ba58deac41202ba069336767b3ad1cdd80f7..9935b07432d9061b0477e296c3de7118f59f77f4 100755 (executable)
@@ -9,7 +9,7 @@ for arg in "$@"; do
     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
index b43d9602d2209e9c9b1d3b2ff6b0d3f1fe7f80c6..c0c26715b8909b0028548dc8669490ec87124040 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 """": # -*-python-*-
-bup_python="$(dirname "$0")/../cmd/bup-python" || exit $?
+bup_python="$(dirname "$0")/../config/bin/python" || exit $?
 exec "$bup_python" "$0" ${1+"$@"}
 """
 
index ce94f78683040a0cfee70282c43e2190c6e5004e..e5068da62043b357bdf8037083fe483ddf60b131 100755 (executable)
@@ -1,6 +1,6 @@
 #!/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
index 127f85d85948c1f69b058b28d9512ff569caa35b..5347b5aef1df0a9b71b8e0b6862a82d00fa7d9c4 100755 (executable)
@@ -8,7 +8,7 @@ for arg in "$@"; do
     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
index 0e6458a1fed7829422b87562ac65f711e28ecca0..2d17e37b4fa3d1eb8c47c27bc2ef1fe4bf9a7b9a 100755 (executable)
@@ -8,7 +8,7 @@ for arg in "$@"; do
     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
index 9c240fa96fc6db9cde734263e5411c7969ac69f2..e54696a21e05700e910fc7e3a9fab4831e8b6e44 100755 (executable)
@@ -1,6 +1,6 @@
 #!/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
index 4d67341e5330c7e725ebb50915a7128a5e54c173..3ea72266a121f4e7e323096dd16bd235222763dc 100644 (file)
--- a/t/lib.sh
+++ b/t/lib.sh
@@ -2,10 +2,8 @@
 
 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()
 {
index d500fb47b7c7d173944922879638d0d3049e913b..af80643f3a6e7a57056bff8eb55e817d25579e69 100755 (executable)
@@ -1,6 +1,6 @@
 #!/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
index 3a580db3350fb385b3b5976f307ee88714d4cdf4..88372c3a882294294d18eb8292fb5513496056b7 100755 (executable)
--- a/t/mksock
+++ b/t/mksock
@@ -1,6 +1,6 @@
 #!/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
index b9970f8778c33e1a16bf95bc4a2fa4c11911db9b..d1387495272b9912d494c29c62d15fa115cccdaa 100755 (executable)
@@ -8,7 +8,7 @@ for arg in "$@"; do
     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
index 7127f8c1277172a81d358c2244286dea7c36ecd5..c37806dbd35fede05e66d66485be6b31f9617d48 100755 (executable)
@@ -1,6 +1,6 @@
 #!/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
index d777f3cff94dc633f1bfd6186139b5e117c808eb..096d042f102cd0eda3a7c9544befe71776b9d4f8 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 """": # -*-python-*-
-bup_python="$(dirname "$0")/../cmd/bup-python" || exit $?
+bup_python="$(dirname "$0")/../dev/bup-python" || exit $?
 exec "$bup_python" "$0" ${1+"$@"}
 """
 
index bcc21bbb31fb4fb19cba772f6d08499115041f45..1077393cd95d09b603c2e7df03f5c6354f9064b1 100755 (executable)
@@ -1,6 +1,6 @@
 #!/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
index 6d83b763559539f3df5cb5ab03d650025f2a7e56..818619f323514aa57837634173be54e148a009e3 100755 (executable)
@@ -1,6 +1,6 @@
 #!/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
index 6aed72415494c2a8cef5e8034f600a65a970a4df..a43824101ec09bf33681b8932f34b45091acb068 100755 (executable)
@@ -1,6 +1,6 @@
 #!/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
index 1ed35542473f09db017633c4b04317d7bfd68c0e..d219d557eb2ad44290d15edb3746471fe5a33a58 100755 (executable)
@@ -40,7 +40,7 @@ bup() { "$top/bup" "$@"; }
 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)))"
 }
 
@@ -49,7 +49,7 @@ export TZ=UTC
 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 $?
index 4c28fe58199f576afc9bd530d36e0fcc91008259..0c849abbcc1211d7d4d37c2e12cb9839c9a1814b 100755 (executable)
@@ -8,7 +8,7 @@ for arg in "$@"; do
     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
index 2912476213ae558ea365c507e19acd3bd59b45dd..23e15d79adad076e868a6f0ca701ca2375e2c807 100755 (executable)
--- a/t/test-ls
+++ b/t/test-ls
@@ -51,9 +51,9 @@ WVPASS bup save -n src -d 242312160 --strip src
 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)
@@ -169,7 +169,7 @@ bad_symlink_date="$(WVPASS echo "$bad_symlink_bup_info" \
 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.
@@ -190,7 +190,7 @@ symlink_date="$(WVPASS echo "$symlink_bup_info" \
 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.
index eb1f97b4896dae028cc003934fea42a56cbc7142..3af9346cae1ada66403c5f3d667c50274b76ed00 100755 (executable)
@@ -43,7 +43,8 @@ id-other-than()
 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 \
@@ -439,9 +440,9 @@ src/foo/3"
     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")"
 
@@ -719,7 +720,7 @@ if [ "$root_status" = root ]; then
                 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 $?
@@ -743,7 +744,7 @@ if [ "$root_status" = root ]; then
             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 $?
 
@@ -765,7 +766,7 @@ if [ "$root_status" = root ]; then
             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 $?
 
index 5b079939b606f094d06893fd190d5c669cf68aff..068ba6f14dbf7e5885a4caeb52fe9ca1ce9f12da 100755 (executable)
@@ -1,6 +1,6 @@
 #!/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
index 84f3b08a2cc145ff6eddb0b0c556f098a62e0fd1..4e676100134b0a006f99806723e896e242426973 100755 (executable)
@@ -82,7 +82,7 @@ WVPASS grep -qE "^uid: $other_uid\$" foo-xstat
 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)
index 312a9f578ef924c516c861e4d548cdf04c550d4d..14fd47f8fe2888896e97bc46a57d4809d51b249e 100755 (executable)
@@ -33,9 +33,7 @@ WVPASS bup index "$tmpdir/save"
 # 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
@@ -45,7 +43,7 @@ def from_path(path, *args, **kw):
     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"
 
@@ -72,9 +70,7 @@ WVPASS bup index --clear
 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
@@ -84,7 +80,7 @@ def from_path(path, *args, **kw):
     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"
 
@@ -107,9 +103,7 @@ WVPASS bup index --clear
 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
@@ -122,7 +116,7 @@ class DupReader(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"
 
index fdbfa4bc210d5e75fd480ba14f4ada355808778e..1a207e92178fbf02cff2a3d0a20aca5fd95b397d 100755 (executable)
@@ -18,7 +18,7 @@ WVPASS cd "$tmpdir"
 
 # 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))
@@ -142,7 +142,7 @@ WVPASS bup restore --sparse -C restore "src/latest/$(pwd)/"
 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)
index 332ee0dbf17c7328bac6ada869401ca5bdb19ee7..24a68a4109c97fc2a9701908d03f99831ec440fd 100755 (executable)
@@ -33,7 +33,7 @@ if test -z "$(type -p curl)"; then
     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'
index 7e55191e1856e98cc373e29e9b68f356cf0c4a2a..937e7086f05af40878c10df40887e277ae475a94 100755 (executable)
@@ -1,6 +1,6 @@
 #!/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
index 6a302d7bae697fa87be99c03f409d9869cfda9df..9d3ee497ab715c8e2322c7e6a855d585f0679aee 100755 (executable)
--- a/wvtest.py
+++ b/wvtest.py
@@ -1,6 +1,6 @@
 #!/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