[PATCH 14/17] hashsplitter: only refer to posix_fadvise if it's going to be used

4 views
Skip to first unread message

Rob Browning

unread,
Apr 15, 2023, 6:02:02 PM4/15/23
to bup-...@googlegroups.com
If HASHSPLITTER_ADVISE isn't defined, then POSIX_FADV_DONTNEED isn't
defined, meaning that we likely don't have posix_fadvise, so don't try
to refer to it. The previous arrangement failed to compile on systems
without posix_fadvise (like macos).

Signed-off-by: Rob Browning <r...@defaultvalue.org>
Tested-by: Rob Browning <r...@defaultvalue.org>
---
lib/bup/_hashsplit.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/bup/_hashsplit.c b/lib/bup/_hashsplit.c
index 394253622..289509638 100644
--- a/lib/bup/_hashsplit.c
+++ b/lib/bup/_hashsplit.c
@@ -348,6 +348,8 @@ static PyObject *HashSplitter_iter(PyObject *self)
return self;
}

+#ifdef HASHSPLITTER_ADVISE
+
static int bup_py_fadvise(int fd, off_t offset, off_t len, int advice)
{
const int rc = posix_fadvise(fd, offset, len, advice);
@@ -367,7 +369,6 @@ static int bup_py_fadvise(int fd, off_t offset, off_t len, int advice)
}
}

-#ifdef HASHSPLITTER_ADVISE
static int HashSplitter_uncache(HashSplitter *self, int last)
{
if (!self->mincore)
@@ -425,7 +426,7 @@ static int HashSplitter_uncache(HashSplitter *self, int last)
}
return 0;
}
-#endif
+#endif /* defined HASHSPLITTER_ADVISE */

static int HashSplitter_read(HashSplitter *self)
{
--
2.39.2

Rob Browning

unread,
Apr 15, 2023, 6:02:02 PM4/15/23
to bup-...@googlegroups.com
Because ./configure changes the working directory to config/, relative
MAKE paths would end up creating an invalid symlink in config/bin.

Thanks to Greg Troxel for reporting the problem.

Signed-off-by: Rob Browning <r...@defaultvalue.org>
Tested-by: Rob Browning <r...@defaultvalue.org>
---
config/configure | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/config/configure b/config/configure
index 657155a0f..f6d751424 100755
--- a/config/configure
+++ b/config/configure
@@ -86,6 +86,12 @@ fi

bup-add-cflag-if-supported -Wno-unused-command-line-argument

+# Since ./configure changes pwd, fix MAKE if it's relative
+case "$MAKE" in
+ /*) ;;
+ */*) MAKE="../../$MAKE";;
+esac
+
for make_candidate in make gmake; do
found_make="$(bup_find_prog "$make_candidate" "$MAKE")"
if test "$found_make" \
--
2.39.2

Rob Browning

unread,
Apr 15, 2023, 6:02:02 PM4/15/23
to bup-...@googlegroups.com, Moritz Lell
From: Moritz Lell <mle...@gmail.com>

If the git config option init.defaultBranch is not set, git init
prints a message on how to change the default branch name. The default
branch name is never used, so the message is irrelevant and might be
confusing for users. Setting some explicit default branch name
suppresses that warning.

The message might not appear for most frequent git users, as they will
have set git config --global init.defaultBranch at some point to get
rid of this message on git init. However, it will affect most new
users and users that use only bup, not git. It is therefore an UX
improvement.

Signed-off-by: Moritz Lell <mle...@gmail.com>
---
lib/bup/git.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/bup/git.py b/lib/bup/git.py
index d6a745c02..00c4796f1 100644
--- a/lib/bup/git.py
+++ b/lib/bup/git.py
@@ -1200,7 +1200,10 @@ def init_repo(path=None):
% path_msg(parent))
if os.path.exists(d) and not os.path.isdir(os.path.join(d, b'.')):
raise GitError('"%s" exists but is not a directory\n' % path_msg(d))
- p = subprocess.Popen([b'git', b'--bare', b'init'], stdout=sys.stderr,
+ p = subprocess.Popen([ b'git', b'--bare',
+ # arbitrary default branch name to suppress git msg.
+ b'-c', b'init.defaultBranch=main', b'init'],
+ stdout=sys.stderr,
env=_gitenv(),
close_fds=True)
_git_wait('git init', p)
--
2.39.2

Rob Browning

unread,
Apr 15, 2023, 6:02:02 PM4/15/23
to bup-...@googlegroups.com
Since python intends to break this too, supposedly in 3.13.

Signed-off-by: Rob Browning <r...@defaultvalue.org>
Tested-by: Rob Browning <r...@defaultvalue.org>
---
test/lib/buptest/__init__.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/lib/buptest/__init__.py b/test/lib/buptest/__init__.py
index 627a8e6f1..7285a9c8b 100644
--- a/test/lib/buptest/__init__.py
+++ b/test/lib/buptest/__init__.py
@@ -2,7 +2,7 @@
from __future__ import absolute_import, print_function
from collections import namedtuple
from os.path import abspath, basename, dirname, realpath
-from pipes import quote
+from shlex import quote
from subprocess import PIPE, Popen
from traceback import extract_stack
import errno, os, subprocess, sys, tempfile
--
2.39.2

Rob Browning

unread,
Apr 15, 2023, 6:02:02 PM4/15/23
to bup-...@googlegroups.com
Yet another nanosecond access variant. This applies to macos too.

Signed-off-by: Rob Browning <r...@defaultvalue.org>
Tested-by: Rob Browning <r...@defaultvalue.org>
---
config/configure | 16 ++++++++++------
lib/bup/_helpers.c | 4 ++++
2 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/config/configure b/config/configure
index 565da9106..f5b721999 100755
--- a/config/configure
+++ b/config/configure
@@ -309,13 +309,17 @@ AC_SUB bup_readline_ldflags "$bup_readline_ldflags"
AC_SUB bup_have_readline "$bup_have_readline"


-AC_CHECK_FIELD stat st_atim sys/types.h sys/stat.h unistd.h
-AC_CHECK_FIELD stat st_mtim sys/types.h sys/stat.h unistd.h
-AC_CHECK_FIELD stat st_ctim sys/types.h sys/stat.h unistd.h
+AC_CHECK_FIELD stat st_atim sys/stat.h
+AC_CHECK_FIELD stat st_mtim sys/stat.h
+AC_CHECK_FIELD stat st_ctim sys/stat.h

-AC_CHECK_FIELD stat st_atimensec sys/types.h sys/stat.h unistd.h
-AC_CHECK_FIELD stat st_mtimensec sys/types.h sys/stat.h unistd.h
-AC_CHECK_FIELD stat st_ctimensec sys/types.h sys/stat.h unistd.h
+AC_CHECK_FIELD stat st_atimensec sys/stat.h
+AC_CHECK_FIELD stat st_mtimensec sys/stat.h
+AC_CHECK_FIELD stat st_ctimensec sys/stat.h
+
+AC_CHECK_FIELD stat st_atimespec sys/stat.h
+AC_CHECK_FIELD stat st_mtimespec sys/stat.h
+AC_CHECK_FIELD stat st_ctimespec sys/stat.h

AC_CHECK_FIELD tm tm_gmtoff time.h

diff --git a/lib/bup/_helpers.c b/lib/bup/_helpers.c
index 4de72547a..94dae4de0 100644
--- a/lib/bup/_helpers.c
+++ b/lib/bup/_helpers.c
@@ -1364,6 +1364,10 @@ static PyObject *bup_lutimes(PyObject *self, PyObject *args)
# define BUP_STAT_MTIME_NS(st) (st)->st_mtim.tv_nsec
# define BUP_STAT_CTIME_NS(st) (st)->st_ctim.tv_nsec
#elif defined HAVE_STAT_ST_ATIMENSEC
+# define BUP_STAT_ATIME_NS(st) (st)->st_atimensec.tv_nsec
+# define BUP_STAT_MTIME_NS(st) (st)->st_mtimensec.tv_nsec
+# define BUP_STAT_CTIME_NS(st) (st)->st_ctimensec.tv_nsec
+#elif defined HAVE_STAT_ST_ATIMESPEC
# define BUP_STAT_ATIME_NS(st) (st)->st_atimespec.tv_nsec
# define BUP_STAT_MTIME_NS(st) (st)->st_mtimespec.tv_nsec
# define BUP_STAT_CTIME_NS(st) (st)->st_ctimespec.tv_nsec
--
2.39.2

Rob Browning

unread,
Apr 15, 2023, 6:02:02 PM4/15/23
to bup-...@googlegroups.com
For now, include all the arguments in the GitError thrown so that even
if git doesn't report the information, it'll still be available in the
output.

Thanks to Moritz Lell for the suggestion.

Signed-off-by: Rob Browning <r...@defaultvalue.org>
Tested-by: Rob Browning <r...@defaultvalue.org>
---
lib/bup/git.py | 17 +++++++----------
1 file changed, 7 insertions(+), 10 deletions(-)

diff --git a/lib/bup/git.py b/lib/bup/git.py
index 00c4796f1..015350f3d 100644
--- a/lib/bup/git.py
+++ b/lib/bup/git.py
@@ -3,7 +3,6 @@ bup repositories are in Git format. This library allows us to
interact with the Git data structures.
"""

-from __future__ import absolute_import, print_function
import os, sys, zlib, subprocess, struct, stat, re, glob
from array import array
from binascii import hexlify, unhexlify
@@ -29,6 +28,7 @@ from bup.helpers import (Sha1, add_error, chunkyreader, debug1, debug2,
mmap_read, mmap_readwrite,
nullcontext_if_not,
progress, qprogress, stat_if_exists,
+ quote,
temp_dir,
unlink,
utc_offset_str)
@@ -1158,21 +1158,18 @@ def update_ref(refname, newval, oldval, repo_dir=None, force=False):
oldarg = [hexlify(oldval)]
assert refname.startswith(b'refs/heads/') \
or refname.startswith(b'refs/tags/')
- p = subprocess.Popen([b'git', b'update-ref', refname,
- hexlify(newval)] + oldarg,
- env=_gitenv(repo_dir),
- close_fds=True)
- _git_wait(b'git update-ref', p)
+ cmd = [b'git', b'update-ref', refname, hexlify(newval)] + oldarg
+ p = subprocess.Popen(cmd, env=_gitenv(repo_dir), close_fds=True)
+ _git_wait(b' '.join(quote(x) for x in cmd), p)


def delete_ref(refname, oldvalue=None):
"""Delete a repository reference (see git update-ref(1))."""
assert refname.startswith(b'refs/')
oldvalue = [] if not oldvalue else [oldvalue]
- p = subprocess.Popen([b'git', b'update-ref', b'-d', refname] + oldvalue,
- env=_gitenv(),
- close_fds=True)
- _git_wait('git update-ref', p)
+ cmd = [b'git', b'update-ref', b'-d', refname] + oldvalue
+ p = subprocess.Popen(cmd, env=_gitenv(), close_fds=True)
+ _git_wait(b' '.join(quote(x) for x in cmd), p)


def guess_repo():
--
2.39.2

Rob Browning

unread,
Apr 15, 2023, 6:02:02 PM4/15/23
to bup-...@googlegroups.com
I've just pushed these, in part to get the tests passing everywhere
again. Please let me know if you see any trouble.

Moritz Lell (2):
Suppress the git main branch name message on bup init
README: update Cygwin instructions

Rob Browning (15):
configure: handle relative MAKE paths
README: move platform specific build instructions to new section
test_get: remove vestigial debug messages
git: include arguments in update-ref command errors
conftest.py: restore support for pytest < 7
configure.inc: use modern int main(int argc, char **argv) signature
configure: add missing AC_CHECK_FUNC headers
AC_CHECK_FUNC: test existence via pointer diff
Support stat_t atimespec/mtimespec/ctimespec for bsds
configure: allow and prefer python3.11-config; ignore 3.6
bup-get(1): remove EXPERIMENTAL warning (keep a caution)
hashsplitter: only refer to posix_fadvise if it's going to be used
buptest init: get quote from shlex not pipes
config/bin: drop in favor of config.var
configure: support PATH make

.gitignore | 1 -
Documentation/bup-get.md | 4 +-
Makefile | 4 +-
README.md | 72 ++++++++++++++++----------
config/configure | 98 ++++++++++++++++++++++--------------
config/configure.inc | 24 ++++-----
lib/bup/_hashsplit.c | 5 +-
lib/bup/_helpers.c | 4 ++
lib/bup/git.py | 22 ++++----
test/ext/conftest.py | 12 +++--
test/ext/test_get.py | 3 --
test/lib/buptest/__init__.py | 2 +-
12 files changed, 151 insertions(+), 100 deletions(-)

--
2.39.2

Rob Browning

unread,
Apr 15, 2023, 6:02:02 PM4/15/23
to bup-...@googlegroups.com
Signed-off-by: Rob Browning <r...@defaultvalue.org>
---
README.md | 79 ++++++++++++++++++++++++++++++++-----------------------
1 file changed, 46 insertions(+), 33 deletions(-)

diff --git a/README.md b/README.md
index f6ef8fcf0..262b6577d 100644
--- a/README.md
+++ b/README.md
@@ -113,7 +113,8 @@ Getting started
From source
-----------

- - Check out the bup source code using git:
+ - Check out the bup source code using git (for Cygwin, use a Cygwin
+ installed git so that symlinks will work by defaul):

```sh
git clone https://github.com/bup/bup
@@ -130,45 +131,21 @@ From source
You can see the latest stable release here:
https://github.com/bup/bup/tags

- - Install the required python libraries (including the development
+ - Ensure you have a Python 3.7+ development environment available and
+ install the required python libraries (including the development
libraries).

+ See the relevant [platform specific information](#platform-specific-information)
+ below, if available, and if not, refer to the [Debian notes](#notes-on-debian)
+ to get a general idea of what's required. You might also want to
+ look at the `dev/prep-for-*` scripts. Those include all the
+ commands used to prepare to build bup for testing on the platform.
+
For `bup fuse` you will need to install
[python-fuse](https://github.com/libfuse/python-fuse) rather than
[fusepy](https://github.com/fusepy/fusepy). For example, in
Debian, install python3-fuse rather than python3-fusepy.

- On very recent Debian/Ubuntu versions, this may be sufficient (run
- as root):
-
- ```sh
- apt-get build-dep bup
- ```
-
- Otherwise try this:
-
- ```sh
- apt-get install python3-dev python3-fuse
- apt-get install python3-pyxattr python3-pytest
- apt-get install python3-distutils
- apt-get install pkg-config linux-libc-dev libacl1-dev
- apt-get install gcc make acl attr rsync
- apt-get isntall python3-pytest-xdist # optional (parallel tests)
- apt-get install par2 # optional (error correction)
- apt-get install libreadline-dev # optional (bup ftp)
- apt-get install python3-tornado # optional (bup web)
-
- ```
-
- On Cygwin, install the gcc-core, git, python3-devel, make, and
- rsync packages. Optionally, install libreadline-devel and par2.
- To generate the help pages, install pandoc (outside of Cygwin).
-
- Installing git on Windows in Cygwin, rather than by other means,
- has the advantage that the installation can handle the symlinks in
- this repository. So if you use another git installation, ensure
- that the symlinks (e.g. `./bup`) are not converted to text files.
-
If you would like to use the optional bup web server on systems
without a tornado package, you may want to try this:

@@ -428,6 +405,33 @@ Using bup
That's all there is to it!


+Platform specific information
+=============================
+
+Notes on Debian (and likely, on derivatives like Ubuntu)
+--------------------------------------------------------
+
+If your distribution is recent enough, or includes new enough `apt`
+sources, this may be sufficient (run as root):
+
+ ```sh
+ apt-get build-dep bup
+ ```
+
+Otherwise try this:
+
+ ```sh
+ apt-get install python3-dev python3-fuse
+ apt-get install python3-pyxattr python3-pytest
+ apt-get install python3-distutils
+ apt-get install pkg-config linux-libc-dev libacl1-dev
+ apt-get install gcc make acl attr rsync
+ apt-get isntall python3-pytest-xdist # optional (parallel tests)
+ apt-get install par2 # optional (error correction)
+ apt-get install libreadline-dev # optional (bup ftp)
+ apt-get install python3-tornado # optional (bup web)
+ ```
+
Notes on FreeBSD
----------------

@@ -471,6 +475,15 @@ Notes on NetBSD/pkgsrc
Notes on Cygwin
---------------

+- To prepare to build build bup, install the gcc-core, git,
+ python3-devel, make, and rsync packages. Optionally, install
+ libreadline-devel (for `bup ftp`) and par2. To generate the help
+ pages, install pandoc (outside of Cygwin).
+
+ Use a Cygwin installed git so that symlinks will work by default.
+ If you try some other git version, ensure that the symlinks (e.g.
+ `./bup`) are not converted to text files.
+
- There is no support for ACLs. If/when some enterprising person
fixes this, adjust dev/compare-trees.

--
2.39.2

Rob Browning

unread,
Apr 15, 2023, 6:02:02 PM4/15/23
to bup-...@googlegroups.com
This eliminates a number of spurious warnings in the config.log.

Signed-off-by: Rob Browning <r...@defaultvalue.org>
Tested-by: Rob Browning <r...@defaultvalue.org>
---
config/configure.inc | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/config/configure.inc b/config/configure.inc
index ed3b5c4b0..ff637bdc5 100644
--- a/config/configure.inc
+++ b/config/configure.inc
@@ -304,7 +304,7 @@ AC_CHECK_HEADERS () {
for hdr in $*; do
echo "#include <$hdr>" >> "$__ac_tmpdir/ngc$$.c"
done
- echo "main() { }" >> "$__ac_tmpdir/ngc$$.c"
+ echo "int main(int argc, char **argv) { }" >> "$__ac_tmpdir/ngc$$.c"

LOGN "checking for header $hdr"

@@ -337,7 +337,7 @@ while [ "$1" ]; do
done

cat >> "$__ac_tmpdir/ngc$$.c" << EOF
-main()
+int main(int argc, char **argv)
{

$F();
@@ -379,7 +379,7 @@ AC_CHECK_STRUCT () {
done

cat >> "$__ac_tmpdir/ngc$$.c" << EOF
-main()
+int main(int argc, char **argv)
{
struct $struct foo;
}
@@ -419,7 +419,7 @@ AC_CHECK_FIELD () {
done

cat >> "$__ac_tmpdir/ngc$$.c" << EOF
-main()
+int main(int argc, char **argv)
{
struct $struct foo;

@@ -450,7 +450,7 @@ AC_PROG_CC () {

cat > "$__ac_tmpdir/ngc$$.c" << \EOF
#include <stdio.h>
-main()
+int main(int argc, char **argv)
{
puts("hello, sailor");
}
@@ -874,7 +874,7 @@ AC_HEADER_SYS_WAIT () {
AC_TYPE_PID_T () {
cat > "$__ac_tmpdir/pd$$.c" << EOF
#include <sys/types.h>
-main() { pid_t me; }
+int main(int argc, char **argv) { pid_t me; }
EOF

LOGN "checking for pid_t"
@@ -920,7 +920,7 @@ EOF
AC_SCALAR_TYPES () {
cat > "$__ac_tmpdir/pd$$.c" << EOF
#include <stdio.h>
-main()
+int main(int argc, char **argv)
{
unsigned long v_long;
unsigned int v_int;
@@ -1029,7 +1029,7 @@ AC_CHECK_FLOCK() {
#include <sys/types.h>
#include <fcntl.h>

-main()
+int main(int argc, char **argv)
{
int x = open("$$.c", O_RDWR, 0666);
int y = open("$$.c", O_RDWR, 0666);
@@ -1080,7 +1080,7 @@ AC_CHECK_RESOLVER () {
#include <arpa/nameser.h>
#include <resolv.h>

-main()
+int main(int argc, char **argv)
{
char bfr[256];

@@ -1111,7 +1111,7 @@ EOF
#include <arpa/nameser.h>
#include <resolv.h>

-main()
+int main(int argc, char **argv)
{
HEADER hhh;
res_init();
--
2.39.2

Rob Browning

unread,
Apr 15, 2023, 6:02:02 PM4/15/23
to bup-...@googlegroups.com
Rely on config/config.var/bup-make instead of a config/bin symlink.
Though a bit simpler, it'll also allow us to support the
make/gmake/etc. in the PATH when that's suitable.

Signed-off-by: Rob Browning <r...@defaultvalue.org>
Tested-by: Rob Browning <r...@defaultvalue.org>
---
.gitignore | 1 -
Makefile | 4 ++--
config/configure | 4 ----
3 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/.gitignore b/.gitignore
index 7b3c53170..c4cdb8958 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,5 @@
*.swp
*~
-/config/bin/make
/config/config.h.tmp
/config/finished
/dev/bup-exec
diff --git a/Makefile b/Makefile
index e7f6ff948..567482c23 100644
--- a/Makefile
+++ b/Makefile
@@ -4,11 +4,11 @@
.SUFFIXES:

default: config/finished
- config/bin/make
+ "$$(cat config/config.var/bup-make)"

.DEFAULT:
$(MAKE) config/finished
- config/bin/make $(.TARGETS)
+ "$$(cat config/config.var/bup-make)" $(.TARGETS)

# Dependency changes here should be mirrored in GNUmakefile
config/finished: configure config/configure config/configure.inc config/*.in
diff --git a/config/configure b/config/configure
index 64e558d69..944ca2978 100755
--- a/config/configure
+++ b/config/configure
@@ -374,10 +374,6 @@ echo -n "$bup_python_config" > config.var.tmp/bup-python-config
echo -n "$with_pylint" > config.var.tmp/with-pylint
mv config.var.tmp config.var

-if test -e bin; then rm -r bin; fi
-mkdir -p bin
-(cd bin && ln -s "$MAKE" make)
-
touch finished

printf "
--
2.39.2

Rob Browning

unread,
Apr 15, 2023, 6:02:03 PM4/15/23
to bup-...@googlegroups.com
Signed-off-by: Rob Browning <r...@defaultvalue.org>
---
test/ext/test_get.py | 3 ---
1 file changed, 3 deletions(-)

diff --git a/test/ext/test_get.py b/test/ext/test_get.py
index 3fc1abfcf..03630fbc1 100644
--- a/test/ext/test_get.py
+++ b/test/ext/test_get.py
@@ -164,7 +164,6 @@ def _validate_save(orig_dir, save_path, commit_id, tree_id):
def validate_save(dest_name, restore_subpath, commit_id, tree_id, orig_value,
get_out):
out = get_out.splitlines()
- print('blarg: out', repr(out), file=sys.stderr)
wvpasseq(2, len(out))
get_tree_id = out[0]
get_commit_id = out[1]
@@ -292,8 +291,6 @@ def verify_only_refs(**kwargs):
wvpasseq(b'', exr.out.strip())

def _test_replace(get_disposition, src_info):
- print('blarg:', repr(src_info), file=sys.stderr)
-
wvstart(get_disposition + ' --replace to root fails')
for item in (b'.tag/tinyfile',
b'src/latest' + src_info['tinyfile-path'],
--
2.39.2

Rob Browning

unread,
Apr 15, 2023, 6:02:03 PM4/15/23
to bup-...@googlegroups.com
Should be portable (i.e. doesn't require intptr_t), and eliminates a
bunch of config.log "undefined" warnings. Though this does require
the headers to be correct, which wasn't true before.

Signed-off-by: Rob Browning <r...@defaultvalue.org>
Tested-by: Rob Browning <r...@defaultvalue.org>
---
config/configure.inc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/config/configure.inc b/config/configure.inc
index ff637bdc5..415e67c87 100644
--- a/config/configure.inc
+++ b/config/configure.inc
@@ -337,10 +337,10 @@ while [ "$1" ]; do
done

cat >> "$__ac_tmpdir/ngc$$.c" << EOF
+#include <stdio.h>
int main(int argc, char **argv)
{
-
- $F();
+ return (void *) $F - (void *) printf;
}
EOF

--
2.39.2

Rob Browning

unread,
Apr 15, 2023, 6:02:03 PM4/15/23
to bup-...@googlegroups.com
If a suitable make is found via the PATH, leave it alone, i.e. don't
convert it to a relative or absolute path.

Signed-off-by: Rob Browning <r...@defaultvalue.org>
Tested-by: Rob Browning <r...@defaultvalue.org>
---
config/configure | 61 +++++++++++++++++++++++++++++++-----------------
1 file changed, 40 insertions(+), 21 deletions(-)

diff --git a/config/configure b/config/configure
index 944ca2978..bbc2c0d00 100755
--- a/config/configure
+++ b/config/configure
@@ -55,6 +55,19 @@ bup-add-cflag-if-supported()
fi
}

+bup-validate-make()
+{
+ if test $# -ne 1 || test -z "$1"; then
+ AC_FAIL "bup-validate-make: invalid arguments: $(printf " %q" "$@")"
+ fi
+ local candidate="$1" ver
+ "$candidate" --version | grep -q "GNU Make" || return 1
+ ver=$("$candidate" --version | grep "GNU Make" | awk '{print $3}')
+ test "$ver" || return 1
+ expr "$ver" '>=' '3.81' > /dev/null || return 1
+ return 0
+}
+

TARGET=bup

@@ -86,32 +99,38 @@ fi

bup-add-cflag-if-supported -Wno-unused-command-line-argument

-# Since ./configure changes pwd, fix MAKE if it's relative
-case "$MAKE" in
- /*) ;;
- */*) MAKE="../../$MAKE";;
-esac

-for make_candidate in make gmake; do
- found_make="$(bup_find_prog "$make_candidate" "$MAKE")"
- if test "$found_make" \
- && ("$found_make" --version | grep "GNU Make"); then
- MAKE="$found_make"
- break;
- fi
-done
+TLOGN "checking for make"

-if ! test "$MAKE"; then
- AC_FAIL "ERROR: unable to find GNU make as make or gmake"
+bup_make=''
+
+if test "${MAKE:-}"; then
+ # Since ./configure changes pwd, fix MAKE if it's relative
+ case "$MAKE" in
+ /*) bup_make="$MAKE";;
+ */*) bup_make="../../$MAKE";;
+ *) bup_make="$MAKE";;
+ esac
+ if ! bup-validate-make "$bup_make"; then
+ TLOG
+ AC_FAIL "ERROR: specified MAKE is not GNU make 3.81+: $MAKE"
+ fi
+else
+ for bup_make_candidate in make gmake; do
+ if bup-validate-make "$bup_make_candidate"; then
+ bup_make="$bup_make_candidate"
+ break;
+ fi
+ done
fi

-MAKE_VERSION=`$MAKE --version | grep "GNU Make" | awk '{print $3}'`
-if [ -z "$MAKE_VERSION" ]; then
- AC_FAIL "ERROR: $MAKE --version does not return sensible output?"
+if ! test "$bup_make"; then
+ AC_FAIL "ERROR: GNU make 3.81+ not found as make or gmake (perhaps set MAKE)"
+else
+ TLOG " ($bup_make)"
fi
-expr "$MAKE_VERSION" '>=' '3.81' || AC_FAIL "ERROR: $MAKE must be >= version 3.81"

-AC_SUB bup_make "$MAKE"
+AC_SUB bup_make "$bup_make"


# Haven't seen a documented way to determine the python version via
@@ -369,7 +388,7 @@ set -euo pipefail

# FIXME: real tmpdir
mkdir -p config.var.tmp
-echo -n "$MAKE" > config.var.tmp/bup-make
+echo -n "$bup_make" > config.var.tmp/bup-make
echo -n "$bup_python_config" > config.var.tmp/bup-python-config
echo -n "$with_pylint" > config.var.tmp/with-pylint
mv config.var.tmp config.var
--
2.39.2

Rob Browning

unread,
Apr 15, 2023, 6:02:03 PM4/15/23
to bup-...@googlegroups.com, Moritz Lell
From: Moritz Lell <mle...@gmail.com>

Also, add a note that the git version must support checking out
symlinks.

Signed-off-by: Moritz Lell <mle...@gmail.com>
Reviewed-by: Rob Browning <r...@defaultvalue.org>
[r...@defaultvalue.org: adjust commit message and instructions a bit]
Signed-off-by: Rob Browning <r...@defaultvalue.org>
---
README.md | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md
index 2d46819d3..f6ef8fcf0 100644
--- a/README.md
+++ b/README.md
@@ -160,7 +160,14 @@ From source

```

- On Cygwin, install python, make, rsync, and gcc4.
+ On Cygwin, install the gcc-core, git, python3-devel, make, and
+ rsync packages. Optionally, install libreadline-devel and par2.
+ To generate the help pages, install pandoc (outside of Cygwin).
+
+ Installing git on Windows in Cygwin, rather than by other means,
+ has the advantage that the installation can handle the symlinks in
+ this repository. So if you use another git installation, ensure
+ that the symlinks (e.g. `./bup`) are not converted to text files.

If you would like to use the optional bup web server on systems
without a tornado package, you may want to try this:
--
2.39.2

Rob Browning

unread,
Apr 15, 2023, 6:02:03 PM4/15/23
to bup-...@googlegroups.com
When pytest is >= 7, use the newer Node constructor (the one that's
not deprecated), otherwise, use the approach in place before
a958f25ecfc479a8b2c0e8a9c95f67b277fcfbb8. Detect the version boundary
by checking for the existence of pytest.version_tuple since it was
added in 7. This should fix the tests where only pytest 6 is
available (e.g. current debian stable (bullseye)).

Signed-off-by: Rob Browning <r...@defaultvalue.org>
Tested-by: Rob Browning <r...@defaultvalue.org>
---
test/ext/conftest.py | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/test/ext/conftest.py b/test/ext/conftest.py
index a65167806..287a68d02 100644
--- a/test/ext/conftest.py
+++ b/test/ext/conftest.py
@@ -9,6 +9,9 @@ from bup.io import byte_stream
# Handle all test-* files as wvtest protocol subprocesses
# cf. https://docs.pytest.org/en/latest/example/nonpython.html

+# version_tuple was added in 7
+use_node_path = hasattr(pytest, 'version_tuple')
+
class BupSubprocFailure(Exception):
def __init__(self, msg, cmd, status, failures):
super(BupSubprocFailure, self).__init__(msg)
@@ -75,10 +78,13 @@ class BupSubprocTestFile(pytest.File):
def pytest_collect_file(parent, path):
base = path.basename
if base.startswith('test-') and not base.endswith('~'):
- try:
+ if use_node_path:
item = BupSubprocTestFile.from_parent(parent, path=Path(path))
- except AttributeError:
- item = BupSubprocTestFile(path, parent)
+ else:
+ try:
+ item = BupSubprocTestFile.from_parent(parent, fspath=path)
+ except AttributeError:
+ item = BupSubprocTestFile(path, parent)
if base == 'test-release-archive':
item.add_marker(pytest.mark.release)
return item
--
2.39.2

Rob Browning

unread,
Apr 15, 2023, 6:02:03 PM4/15/23
to bup-...@googlegroups.com
Drop 3.6 since it's not supported.

Signed-off-by: Rob Browning <r...@defaultvalue.org>
Tested-by: Rob Browning <r...@defaultvalue.org>
---
config/configure | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/config/configure b/config/configure
index f5b721999..64e558d69 100755
--- a/config/configure
+++ b/config/configure
@@ -125,7 +125,7 @@ if test "$BUP_PYTHON_CONFIG"; then
"$BUP_PYTHON_CONFIG")
fi
else
- for py_min_ver in 10 9 8 7 6; do
+ for py_min_ver in 11 10 9 8 7; do
bup_python_config="$(bup_find_prog "python3.$py_min_ver-config" '')"
test -z "$bup_python_config" || break
done
--
2.39.2

Rob Browning

unread,
Apr 15, 2023, 6:02:03 PM4/15/23
to bup-...@googlegroups.com
This eliminates a number of spurious config.log warnings.

Signed-off-by: Rob Browning <r...@defaultvalue.org>
Tested-by: Rob Browning <r...@defaultvalue.org>
---
config/configure | 19 +++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/config/configure b/config/configure
index f6d751424..565da9106 100755
--- a/config/configure
+++ b/config/configure
@@ -187,13 +187,12 @@ AC_CHECK_HEADERS sys/ioctl.h

# On GNU/kFreeBSD utimensat is defined in GNU libc, but won't work.
if [ -z "$OS_GNU_KFREEBSD" ]; then
- AC_CHECK_FUNCS utimensat
+ AC_CHECK_FUNCS utimensat sys/stat.h
fi
-AC_CHECK_FUNCS utimes
-AC_CHECK_FUNCS lutimes
+AC_CHECK_FUNCS utimes sys/time.h
+AC_CHECK_FUNCS lutimes sys/time.h

-
-AC_CHECK_FUNCS mincore
+AC_CHECK_FUNCS mincore sys/mman.h

mincore_incore_code="
#if 0$ac_defined_HAVE_UNISTD_H
@@ -337,12 +336,12 @@ AC_CC="$AC_CC${bup_libacl_cflags:+ $bup_libacl_cflags}"
LIBS="$bup_libacl_ldflags"
AC_CHECK_HEADERS sys/acl.h
AC_CHECK_HEADERS acl/libacl.h
-AC_CHECK_FUNCS acl_get_file
-AC_CHECK_FUNCS acl_from_text
-AC_CHECK_FUNCS acl_set_file
+AC_CHECK_FUNCS acl_get_file sys/acl.h
+AC_CHECK_FUNCS acl_from_text sys/acl.h
+AC_CHECK_FUNCS acl_set_file sys/acl.h
# Note: These are linux specific, but we need them (for now?)
-AC_CHECK_FUNCS acl_extended_file
-AC_CHECK_FUNCS acl_to_any_text
+AC_CHECK_FUNCS acl_extended_file acl/libacl.h
+AC_CHECK_FUNCS acl_to_any_text acl/libacl.h
TLOGN "checking for complete acl support"
if test "$ac_defined_HAVE_ACL_EXTENDED_FILE"; then
bup_have_libacl=1
--
2.39.2

Rob Browning

unread,
Apr 15, 2023, 6:02:03 PM4/15/23
to bup-...@googlegroups.com
Signed-off-by: Rob Browning <r...@defaultvalue.org>
---
Documentation/bup-get.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Documentation/bup-get.md b/Documentation/bup-get.md
index dcc2bd9d1..d046f718a 100644
--- a/Documentation/bup-get.md
+++ b/Documentation/bup-get.md
@@ -4,7 +4,7 @@

# NAME

-bup-get - copy repository items (CAUTION: EXPERIMENTAL)
+bup-get - copy repository items (note CAUTION below)

# SYNOPSIS

@@ -56,7 +56,7 @@ option, and remote *ref*s can be pulled into a local repository via
"bup on HOST get ...". See `bup-on`(1) and the EXAMPLES below for
further information.

-WARNING: This is one of the few bup commands that can modify your
+CAUTION: This is one of the few bup commands that can modify your
archives in intentionally destructive ways. Though if an attempt to
join or restore the data you still care about succeeds after you've
run this command, then that's a fairly encouraging sign that it worked
--
2.39.2

Reply all
Reply to author
Forward
0 new messages