]> arthur.barton.de Git - bup.git/log
bup.git
7 years agoGit: Ignore two more generated files tmp/alex tmp/gitignore-add-gen-files
Alexander Barton [Mon, 26 Dec 2016 19:41:47 +0000 (20:41 +0100)]
Git: Ignore two more generated files

- lib/bup/_checkout.py: Generated by "configure-version",
- config/config.vars.sh: Generated by "config/configure".

Signed-off-by: Alexander Barton <alex@barton.de>
7 years agoUpdate HACKING for 0.29 0.29 0.29-rc2
Rob Browning [Mon, 26 Dec 2016 18:43:21 +0000 (12:43 -0600)]
Update HACKING for 0.29

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
7 years agoAdd note/0.29-from-0.28.1.md and mention in README
Rob Browning [Mon, 26 Dec 2016 18:42:57 +0000 (12:42 -0600)]
Add note/0.29-from-0.28.1.md and mention in README

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
7 years agobup-prune-older.md: remove fictional --keep option
Alexander Barton [Sun, 18 Dec 2016 20:37:51 +0000 (21:37 +0100)]
bup-prune-older.md: remove fictional --keep option

The documentation lists the "--keep" option, but the actual command
doesn't implement it:

 $ bup prune-older --unsafe --keep 7d,1y,10y,100y
 usage: bup prune-older [options...] [BRANCH...]
 [...]
 error: option --keep not a unique prefix

Signed-off-by: Alexander Barton <alex@barton.de>
[rlb@defaultvalue.org: shorten summary line]
Reviewed-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
7 years agoindex: only collect metadata for stale paths
Rob Browning [Sun, 25 Dec 2016 17:44:56 +0000 (11:44 -0600)]
index: only collect metadata for stale paths

Stop collecting all of the metadata for every path, even if the path
hasn't changed since the last save.  Further, rework the code to
short-circuit some other unnecessary work.

To support this, split Entry.from_stat() into two parts, stale(), which
tests to see if an entry has "materially" changed, and
update_from_stat() which updates the entry to match the stat information
provided.

This should substantially decrease the indexing cost for paths that
haven't changed since the last save.

While we're here, rename hashgen to fake_hash so it's clearer that's its
only purpose.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
7 years agoxstat: inline timespec_to_nsecs; guard cygwin fix
Rob Browning [Mon, 26 Dec 2016 18:00:26 +0000 (12:00 -0600)]
xstat: inline timespec_to_nsecs; guard cygwin fix

Profiling revealed this function was on the critical path, and these
changes helped a bit when the cache was hot.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
7 years agotest-prune-older: set test git author/committer
Rob Browning [Mon, 19 Dec 2016 05:47:08 +0000 (23:47 -0600)]
test-prune-older: set test git author/committer

Otherwise the tests fail in a clean build environment.  Thanks to
Robert Edmonds for reporting the problem and reminding me of the
solution.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
7 years agogit.cp(): don't repeatedly recompute default repo 0.29-rc1
Rob Browning [Sat, 17 Dec 2016 20:40:02 +0000 (14:40 -0600)]
git.cp(): don't repeatedly recompute default repo

Before, bup would end up calling repo() for every invocation of cp().
Given that constructions like cp().get(id) are common, this could cause
a lot of unecessary calls, given that we already have git.repodir, which
will have the relevant value once initialized.

Discovered after noticing "bup restore" was hammering
"$BUP_DIR"/.git (which didn't exist).

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
7 years agomips64el can't conceive of lunar landing; adjust
Rob Browning [Sat, 17 Dec 2016 17:24:26 +0000 (11:24 -0600)]
mips64el can't conceive of lunar landing; adjust

i.e. mips64el has an unsigned time_t, causing spurious test-ls.sh
failures.

cf. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=743154

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
7 years agogitignore: remove vestigial lib/bup/_version.py
Rob Browning [Sat, 17 Dec 2016 17:04:13 +0000 (11:04 -0600)]
gitignore: remove vestigial lib/bup/_version.py

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
7 years agogc: restart catpipe after each new pack
Rob Browning [Sat, 10 Dec 2016 17:57:05 +0000 (11:57 -0600)]
gc: restart catpipe after each new pack

Without this, the space taken by the stale packfiles that gc removes
won't be available to the filesystem until the entire gc run ends (or
the catpipe is otherwise reset).

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
7 years agogc: immediately unlink tmp bloom filter file
Rob Browning [Fri, 16 Dec 2016 18:27:27 +0000 (12:27 -0600)]
gc: immediately unlink tmp bloom filter file

...to make sure the bloom filter is always cleaned up on exit.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
7 years agocheck_repo_or_die: don't test via stat "pack/."
Rob Browning [Fri, 16 Dec 2016 17:48:03 +0000 (11:48 -0600)]
check_repo_or_die: don't test via stat "pack/."

Apparently this actually returns valid stat info on OS X now:

  python -c 'import os; print os.stat('plain-file/.')

No idea why, but since check_repo_or_die() currently depends on that
throwing an exception, rewrite it to avoid the problem.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
7 years agotest-prune-older: avoid duplicate save times
Rob Browning [Thu, 15 Dec 2016 18:45:19 +0000 (12:45 -0600)]
test-prune-older: avoid duplicate save times

When creating the list of random save times make sure to avoid any
duplicates since the timestamp is also the trivial commit content.
Otherwise the git commit for the second save dies with "nothing to
commit, working tree clean".

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
7 years agoPULL_REQUEST_TEMPLATE: rewrite a bit
Rob Browning [Sun, 11 Dec 2016 20:19:11 +0000 (14:19 -0600)]
PULL_REQUEST_TEMPLATE: rewrite a bit

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
7 years agoAdd bup prune-older command
Rob Browning [Sun, 30 Oct 2016 18:31:43 +0000 (13:31 -0500)]
Add bup prune-older command

prune-older removes (permanently deletes) all saves except those
preserved by various temporal keep arguments.  It is equivalent to a
suitable "bup rm" invocation followed by "bup gc".

For example, this invocation keeps all saves on the BRANCH for the past
month, and any older monthlies for the past year, and deletes the
remainder:

  $ bup prune-older --keep-all-for 1m --keep-monthlies-for 1y BRANCH

Tested-by: Rob Browning <rlb@defaultvalue.org>
Signed-off-by: Rob Browning <rlb@defaultvalue.org>
7 years agoAdd lowercase versions of python wvtest commands
Rob Browning [Sun, 18 Sep 2016 04:29:54 +0000 (23:29 -0500)]
Add lowercase versions of python wvtest commands

Add python wvstart, wvpass, etc. aliases for WVSTART, WVPASS, etc.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
7 years agowvtest.py: add WVSTART for standalone python tests
Rob Browning [Sun, 18 Sep 2016 04:29:30 +0000 (23:29 -0500)]
wvtest.py: add WVSTART for standalone python tests

Add a WVSTART function so that we can use it in future t/foo tests
written in python.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
7 years agoCONTRIBUTING: rename to CONTRIBUTING.md for link
Rob Browning [Wed, 23 Nov 2016 19:12:48 +0000 (13:12 -0600)]
CONTRIBUTING: rename to CONTRIBUTING.md for link

Hopefully this will allow you to click on the HACKING link.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
7 years agoChange CONTRIBUTING.md symink to plain file
Rob Browning [Wed, 23 Nov 2016 19:05:49 +0000 (13:05 -0600)]
Change CONTRIBUTING.md symink to plain file

The symlink doesn't work, so just replace it with a file containing the
HACKING URL instead.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
7 years agoAdd github PULL_REQUEST_TEMPLATE and CONTRIBUTING.md
Rob Browning [Wed, 23 Nov 2016 18:48:13 +0000 (12:48 -0600)]
Add github PULL_REQUEST_TEMPLATE and CONTRIBUTING.md

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
7 years agowalk_object: ignore blob content if not requested
Ben Kelly [Thu, 10 Nov 2016 15:01:08 +0000 (10:01 -0500)]
walk_object: ignore blob content if not requested

Previously, walk_object would read the contents of each object it
encountered, even if it subsequently threw away those contents.

With this change, it will skip reading the contents of blobs unless
the caller explicitly asked for blob contents. In particular, this
means operations that traverse the object graph without caring
about object contents, such as `bup gc`, now only need to read the
contents of tree and commit objects.

Tested: `make test`; local run against copy of production repo.
Signed-off-by: Ben Kelly <btk@google.com>
[rlb@defaultvalue.org: shorten commit summary; adjust indentation;
 adjust docstring and comment; test "not include_data" first; change to
 type='blob']

Reviewed-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
7 years agoFix default PREFIX in README file
Julien Sanchez [Mon, 4 Jul 2016 10:32:32 +0000 (12:32 +0200)]
Fix default PREFIX in README file

Signed-off-by: Julien Sanchez <julien.sanchez@gmail.com>
Reviewed-by: Rob Browning <rlb@defaultvalue.org>
7 years agoDESIGN: fix typo
Pascal Honoré [Tue, 8 Nov 2016 18:35:54 +0000 (18:35 +0000)]
DESIGN: fix typo

Signed-off-by: Pascal Honoré <pascal@alseyn.net>
Reviewed-by: Rob Browning <rlb@defaultvalue.org>
7 years agoPackWriter: rename write() to just_write()
Rob Browning [Sun, 6 Nov 2016 19:42:08 +0000 (13:42 -0600)]
PackWriter: rename write() to just_write()

Hopefully make the function's purpose a bit clearer.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
7 years agotest-gc: sort ls output defensively before comm
Rob Browning [Sat, 5 Nov 2016 19:36:20 +0000 (14:36 -0500)]
test-gc: sort ls output defensively before comm

Explicitly sort the output of ls before passing it to comm in order to
accommodate some systems that apparently used to change the default sort
order.  The order must match LC_COLLATE for comm to work.

While we're here, improve error checking around the comm invocations.

Thanks to Nick Alcock for reporting the original problem, and proposing
an initial fix.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
7 years agogit: allow multiple refnames in list_refs calls
Rob Browning [Sun, 18 Sep 2016 04:23:26 +0000 (23:23 -0500)]
git: allow multiple refnames in list_refs calls

Tested-by: Rob Browning <rlb@defaultvalue.org>
Signed-off-by: Rob Browning <rlb@defaultvalue.org>
7 years agogc: move core code to bup.gc module
Rob Browning [Sat, 10 Sep 2016 16:29:50 +0000 (11:29 -0500)]
gc: move core code to bup.gc module

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
7 years agobup_rm: narrow code in writer block
Rob Browning [Sat, 6 Aug 2016 14:30:22 +0000 (09:30 -0500)]
bup_rm: narrow code in writer block

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
7 years agobup_rm: take opts as individual arguments
Rob Browning [Sat, 6 Aug 2016 14:26:40 +0000 (09:26 -0500)]
bup_rm: take opts as individual arguments

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
7 years agorm: move core code to bup.rm module
Rob Browning [Sat, 6 Aug 2016 04:01:38 +0000 (23:01 -0500)]
rm: move core code to bup.rm module

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
7 years agowalk_object: rewrite as nonrecursive
Rob Browning [Sat, 22 Oct 2016 15:57:07 +0000 (10:57 -0500)]
walk_object: rewrite as nonrecursive

Given a deep enough bup tree the current recursive version can exceed
the default Python stack limit, resulting in an error like this:

  RuntimeError: maximum recursion depth exceeded in cmp

Rewrite the function as an iteration, and explicitly manage the pending
items as a list on the heap.

Thanks to axion for reporting the problem.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
7 years agoINDEX_SIG: widen children_ofs to 64-bit
Rob Browning [Mon, 10 Oct 2016 20:55:50 +0000 (15:55 -0500)]
INDEX_SIG: widen children_ofs to 64-bit

This should avoid failures when the index grows larger than 4GB.

Update the index format header to 'BUPI\0\0\0\7' (version 7).

Thanks to phillipproell amd Wayne Scott for reporting the problem,
and helping track down the cause/fix.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
Signed-off-by: Rob Browning <rlb@defaultvalue.org>
7 years agoMake INDEX_SIG a bit easier to understand
Rob Browning [Mon, 10 Oct 2016 20:53:19 +0000 (15:53 -0500)]
Make INDEX_SIG a bit easier to understand

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
7 years agoReport unknown root status if getwindowsversion > 5
Rob Browning [Sat, 10 Sep 2016 17:52:59 +0000 (12:52 -0500)]
Report unknown root status if getwindowsversion > 5

Apparently the situation is much more complicated in newer versions, so
until someone more knowledgable can help, don't try to determine
superuser status there.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
7 years agoDetect root-status failures
Rob Browning [Sat, 10 Sep 2016 17:28:40 +0000 (12:28 -0500)]
Detect root-status failures

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
7 years agobup-gc(1): correct default compression level
Rob Browning [Sat, 10 Sep 2016 16:33:57 +0000 (11:33 -0500)]
bup-gc(1): correct default compression level

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
7 years agoRequire Python 2.6 or newer
Rob Browning [Sun, 10 Jul 2016 20:10:21 +0000 (15:10 -0500)]
Require Python 2.6 or newer

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
7 years agowvtest: chdir to start dir before extracting stack
Rob Browning [Sat, 27 Aug 2016 17:11:13 +0000 (12:11 -0500)]
wvtest: chdir to start dir before extracting stack

It looks like traceback may not be able to find the source text if the
current directory has been changed from the original.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
7 years agowvtest: precompile _code() regex
Rob Browning [Sat, 27 Aug 2016 16:54:07 +0000 (11:54 -0500)]
wvtest: precompile _code() regex

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
7 years agoHandle ntfs-3g EINVAL for attr save/restore
Rob Browning [Wed, 7 Sep 2016 04:34:24 +0000 (23:34 -0500)]
Handle ntfs-3g EINVAL for attr save/restore

It appears that ntfs-3g now returns EINVAL for unsupported ioctls
including FS_IOC_GET_FLAGS and FS_IOC_SET_FLAGS.

Treat EINVAL like the existing expected errors for these calls, but
since there's evidence to suggest that other devices/filesystems use
EINVAL to indicate more serious trouble and use ENOTTY to indicate
unsupported ioctls, include a request to report any occurrences of
EINVAL when ntfs-3g is not involved.

Thanks to Mark J Hewitt for reporting the problem.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
7 years agoCheck attr value *after* ensuring call succeeded
Rob Browning [Wed, 7 Sep 2016 04:35:28 +0000 (23:35 -0500)]
Check attr value *after* ensuring call succeeded

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
7 years agowvtest_main: use immutable arg default value
Rob Browning [Sat, 23 Jul 2016 17:14:14 +0000 (12:14 -0500)]
wvtest_main: use immutable arg default value

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
7 years agogc: actually allow --threshold arg
Rob Browning [Sat, 16 Jul 2016 16:33:30 +0000 (11:33 -0500)]
gc: actually allow --threshold arg

Thanks to Andrew Skretvedt for reporting the problem.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
7 years agocleanup-mounts-under: skip if no /proc/mounts
Rob Browning [Sun, 17 Jul 2016 16:46:25 +0000 (11:46 -0500)]
cleanup-mounts-under: skip if no /proc/mounts

Avoid "make clean" failures on "not Linux".

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
7 years agoDon't use multiple with context clauses
Rob Browning [Sat, 16 Jul 2016 17:14:46 +0000 (12:14 -0500)]
Don't use multiple with context clauses

Python 2.6 only supports a single with clause.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
7 years agoimport-duplicity: use readpipe, not check_output
Rob Browning [Sat, 9 Jul 2016 01:13:46 +0000 (20:13 -0500)]
import-duplicity: use readpipe, not check_output

Python 2.6 doesn't have check_output.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
7 years agotest-fuse: skip tests if no fuse module
Rob Browning [Sat, 9 Jul 2016 01:08:03 +0000 (20:08 -0500)]
test-fuse: skip tests if no fuse module

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
7 years agotest-web: s/python/bup-python/
Rob Browning [Sat, 9 Jul 2016 01:03:11 +0000 (20:03 -0500)]
test-web: s/python/bup-python/

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
7 years ago_encode_packobj: raise ValueError for bad level
Rob Browning [Sun, 3 Jul 2016 19:21:20 +0000 (14:21 -0500)]
_encode_packobj: raise ValueError for bad level

Move the compression_level argument test to the start of the function,
be even more restrictive, and add trivial tests.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
7 years ago_encode_packobj: raise BaseException for bad level
Jacob Edelman [Mon, 16 Mar 2015 17:46:08 +0000 (13:46 -0400)]
_encode_packobj: raise BaseException for bad level

Reviewed-by: Rob Browning <rlb@defaultvalue.org>
[rlb@defaultvalue.org: adjust commit message]

7 years agoREADME: git clone with https
Bruno Bigras [Sun, 12 Jun 2016 16:13:39 +0000 (11:13 -0500)]
README: git clone with https

Clone via https:// rather than git:// since it's more widely accessible.

[rlb@defaultvalue.org: augment commit message]
Reviewed-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
7 years agotest-web: silence curl during socket test
Rob Browning [Sat, 2 Jul 2016 16:58:11 +0000 (11:58 -0500)]
test-web: silence curl during socket test

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
7 years agotest-web: skip tests if no tornado
Rob Browning [Mon, 13 Jun 2016 05:00:32 +0000 (00:00 -0500)]
test-web: skip tests if no tornado

Thanks to ilovezfs for reporting the problem and helping with the fix.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
7 years agogc: explicitly handle missing objects
Rob Browning [Sun, 12 Jun 2016 20:50:46 +0000 (15:50 -0500)]
gc: explicitly handle missing objects

Instead of just dying with a KeyError backtrace, detect missing objects
and print a friendlier message about the problem.  Having the new
MissingObject exception derive from KeyError should avoid affecting
existing code.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
7 years agoFix fsyncing on OSX on SMB file-systems
Jonathan Wright [Tue, 28 Jun 2016 23:22:41 +0000 (16:22 -0700)]
Fix fsyncing on OSX on SMB file-systems

Fixes the error:

    Traceback (most recent call last):
      File "/usr/local/Cellar/bup/0.28.1/lib/bup/cmd/bup-server", line 209, in <module>
cmd(conn, rest)
      File "/usr/local/Cellar/bup/0.28.1/lib/bup/cmd/bup-server", line 91, in receive_objects_v2
fullpath = w.close(run_midx=not dumb_server_mode)
      File "/usr/local/Cellar/bup/0.28.1/lib/bup/bup/git.py", line 790, in close
return self._end(run_midx=run_midx)
      File "/usr/local/Cellar/bup/0.28.1/lib/bup/bup/git.py", line 764, in _end
fdatasync(f.fileno())
      File "/usr/local/Cellar/bup/0.28.1/lib/bup/bup/helpers.py", line 47, in <lambda>
fdatasync = lambda fd : fcntl.fcntl(fd, fcntl.F_FULLFSYNC)
    IOError: [Errno 45] Operation not supported
    Traceback (most recent call last):
      File "/usr/local/Cellar/bup/0.28.1/lib/bup/cmd/bup-save", line 460, in <module>
w.close()  # must close before we can update the ref
      File "/usr/local/Cellar/bup/0.28.1/lib/bup/bup/client.py", line 317, in close
id = self._end()
      File "/usr/local/Cellar/bup/0.28.1/lib/bup/bup/client.py", line 314, in _end
return self.suggest_packs() # Returns last idx received
      File "/usr/local/Cellar/bup/0.28.1/lib/bup/bup/client.py", line 229, in _suggest_packs
self.check_ok()
      File "/usr/local/Cellar/bup/0.28.1/lib/bup/bup/client.py", line 134, in check_ok
% rv)

Signed-off-by: Jonathan Wright <quaggy@gmail.com>
Reviewed-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
7 years agoCheck save/split names early via valid_save_name
Rob Browning [Sun, 22 May 2016 18:49:17 +0000 (13:49 -0500)]
Check save/split names early via valid_save_name

Previously, split and save would just wait to see if the final
update_ref failed.  Instead, check the validity of the name early,
before doing any significant work.

Thanks to vi0oss for reporting the problem.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
7 years agoAdd note/0.28-from-0.28.1.md and mention in README 0.28.1
Rob Browning [Sun, 12 Jun 2016 16:18:14 +0000 (11:18 -0500)]
Add note/0.28-from-0.28.1.md and mention in README

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
7 years agotest-web: use path with unique unicode sequence
Rob Browning [Sat, 11 Jun 2016 17:59:38 +0000 (12:59 -0500)]
test-web: use path with unique unicode sequence

Change the test path from "éxcitement" to "¡excitement!" since the
former has multiple valid unicode encodings (e.g. given combining
characters, etc.).

With the previous string, the test might fail if something along the way
normalized it (which was the case on at least some versions of OS X).

Thanks to ilovezfs for reporting the problem and helping with the fix.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
7 years agotest-meta: loosen expected rsync diff pattern
Rob Browning [Sat, 11 Jun 2016 17:15:21 +0000 (12:15 -0500)]
test-meta: loosen expected rsync diff pattern

Homebrew's rsync produces 12 status characters, not 11.

Thanks to ilovezfs for reporting the problem and helping test the fix.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
7 years agoFix release archives and add tests
Rob Browning [Fri, 27 May 2016 00:30:40 +0000 (19:30 -0500)]
Fix release archives and add tests

Previously, an archive created by "git archive" would fail to build,
because the versioning code was broken (in part by
03d35993b87f49753542e705e37949a46964be17) for any build outside a git
clone.  Although "bup version" may not really have been quite right
since the switch from "bup-VERSION" to "VERSION release tags.

Fix the problem by reintroducing the content of the older
_version.py.pre as a permanent _release.py file, which (as with the
previous incarnation) is a template that's expanded during "git archive"
via export-subst (cf. gitattributes(5)).

Add a version module as the public interface to versioning, and have it
sort out whether or not the current tree is an official release.  Adjust
configure-version to manage _checkout.py instead of _version.py (drop
_version.py), so that the version module is effectively just
disambiguating between _release.py and _checkout.py.

Adjust "bup version" to use the new version module and to handle
unprefixed VERSION tags.

Finally, add test-release-archive.sh, invoked via "make distcheck", so
we (hopefully) don't unknowingly break this again.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
7 years agowvtest.sh: fix WVDIE
Rob Browning [Sat, 28 May 2016 16:09:32 +0000 (11:09 -0500)]
wvtest.sh: fix WVDIE

It was unused, and didn't actually work.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
7 years agoAdd config.vars.sh for bup_make and bup_python
Rob Browning [Sat, 28 May 2016 14:37:09 +0000 (09:37 -0500)]
Add config.vars.sh for bup_make and bup_python

During configure create a config/config.vars.sh file including (for now)
properly shell escaped bup_make and bup_python definitions so that we
can use them in other schell scripts.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
7 years agobup-python: respect umask when adding execute bit
Gernot Schulz [Tue, 31 May 2016 08:42:10 +0000 (10:42 +0200)]
bup-python: respect umask when adding execute bit

Signed-off-by: Gernot Schulz <post@gernot-schulz.com>
Reviewed-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
7 years agodrecurse.py: add missing resolve_parent import
Karl Semich [Wed, 1 Jun 2016 16:53:55 +0000 (12:53 -0400)]
drecurse.py: add missing resolve_parent import

Signed-off-by: Karl Semich
Reviewed-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
7 years agoUpdate HACKING and README for 0.28 0.28
Rob Browning [Sat, 21 May 2016 19:36:28 +0000 (14:36 -0500)]
Update HACKING and README for 0.28

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
7 years agoCompute exact sizes via t/data-size in test-gc.sh
Rob Browning [Tue, 24 May 2016 00:15:30 +0000 (19:15 -0500)]
Compute exact sizes via t/data-size in test-gc.sh

Add a t/data-size helper that computes the total data size of all named
paths and use it instead of du in test-gc.sh to determine the
before/after repository sizes.

This should fix spurious test failures on filesystems with a large block
size.  (Observed on ppc64el and powerpc tmpfs filesystems.)

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
7 years agoAdd xattr EACCES fix to release notes 0.28-rc3
Rob Browning [Sat, 21 May 2016 14:19:17 +0000 (09:19 -0500)]
Add xattr EACCES fix to release notes

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
7 years agoDon't return const types from sparse find helpers
Rob Browning [Sat, 21 May 2016 14:03:47 +0000 (09:03 -0500)]
Don't return const types from sparse find helpers

Let the caller decide.

Thanks to Greg Troxel for reporting the problem.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
7 years agoTreat EACCES like EPERM when removing xattrs
Rob Browning [Sat, 21 May 2016 14:11:01 +0000 (09:11 -0500)]
Treat EACCES like EPERM when removing xattrs

Thanks to Brian Minton for reporting the problem on Fedora 23.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
7 years agoAdd thanks to 0.28 release notes 0.28-rc2
Rob Browning [Fri, 20 May 2016 23:29:49 +0000 (18:29 -0500)]
Add thanks to 0.28 release notes

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
7 years agoAdd note/0.27.1-from-0.27.md and mention in README
Rob Browning [Sat, 30 Apr 2016 23:28:02 +0000 (18:28 -0500)]
Add note/0.27.1-from-0.27.md and mention in README

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
7 years agoMerge restore --sparse corruption fix
Rob Browning [Fri, 20 May 2016 02:11:00 +0000 (21:11 -0500)]
Merge restore --sparse corruption fix

7 years agorestore: fix --sparse corruption
Rob Browning [Sun, 24 Apr 2016 16:58:04 +0000 (11:58 -0500)]
restore: fix --sparse corruption

Rework the restore --sparse implementation to fix a bug that might cause
it to produce output that didn't match the original input.

Rewrite the code to probe for sparse regions in min_sparse_len jumps,
searching backward from the jump target for a non-zero byte.  If one is
found, move just past that byte and try again.

This should be substantially more efficient than the previous approach
for non-sparse regions.  In the limiting case, it should read roughly
1/min_sparse_len bytes instead of all of them.

The original bug was masked by the fact that the test that would have
revealed it wasn't actually generating random data (across trials),
something that was fixed in "Use $RANDOM seed for --sparse random
tests".

Thanks to Marcus Schopen for reporting the problem and Frank Gevaerts
for helping track down the solution.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
7 years agotest-sparse-files: use bup-python in master
Rob Browning [Fri, 20 May 2016 02:00:59 +0000 (21:00 -0500)]
test-sparse-files: use bup-python in master

Change python to bup-python after cherry-picking the sparse test in
b5636d001151fe64bc617507200a55af73766819.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
7 years agorestore: test --sparse with zeros at 64k boundary
Frank Gevaerts [Tue, 19 Apr 2016 20:02:49 +0000 (22:02 +0200)]
restore: test --sparse with zeros at 64k boundary

bup restore --sparse fails with short zero runs around 64K boundaries.
The new testcase reproduces that failure

Signed-off-by: Frank Gevaerts <frank@gevaerts.be>
Reviewed-by: Rob Browning <rlb@defaultvalue.org>
[rlb@defaultvalue.org: adjust commit summary]

7 years agorestore: add generative --sparse testing
Rob Browning [Sun, 24 Apr 2016 22:52:02 +0000 (17:52 -0500)]
restore: add generative --sparse testing

Add t/sparse-test-data to automatically generate cases that might trip
up "restore --sparse", and use it in test-sparse-files.sh.  This change
causes the current --sparse code to fail if you run enough trials,
but not as quickly as the existing "bup random" based test.

As compared to the existing "bup random" test, this one should evaluate
larger sparse regions much more often.

Thanks to Frank Gevaerts for help evaluating the fix.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
7 years agoUse $RANDOM seed for --sparse random tests
Rob Browning [Sun, 24 Apr 2016 22:07:39 +0000 (17:07 -0500)]
Use $RANDOM seed for --sparse random tests

Since bup random defaults to a fixed random seed of 1, the restore
--sparse test for random data was actually testing the same data every
time.  Specify a $RANDOM --seed to fix that.

After this change, the affected test fails fairly often.

Thanks to Frank Gevaerts for help evaluating the fix.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
8 years agoAdd note/0.28-from-0.27.md and mention in README 0.28-rc1
Rob Browning [Sun, 3 Apr 2016 18:18:03 +0000 (13:18 -0500)]
Add note/0.28-from-0.27.md and mention in README

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
8 years agoREADME: update deps, platforms, related projects
Rob Browning [Sun, 3 Apr 2016 17:56:49 +0000 (12:56 -0500)]
README: update deps, platforms, related projects

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
8 years agorm/gc: update README and mention testing in bup-gc(1)
Rob Browning [Sun, 3 Apr 2016 17:15:47 +0000 (12:15 -0500)]
rm/gc: update README and mention testing in bup-gc(1)

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
8 years agoReflect availability of experimental rm/gc in docs
Rob Browning [Sun, 3 Apr 2016 16:48:55 +0000 (11:48 -0500)]
Reflect availability of experimental rm/gc in docs

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
8 years agoAdd add_error imports missed in import * removal
stevelr [Sun, 7 Feb 2016 02:05:51 +0000 (18:05 -0800)]
Add add_error imports missed in import * removal

[rlb@defaultvalue.org: rebased on current master; squashed related
 patches; adjusted commit message]
Reviewed-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
8 years agoCheck saved_errors before and after every test
Rob Browning [Sun, 27 Mar 2016 00:33:57 +0000 (19:33 -0500)]
Check saved_errors before and after every test

Add a new buptest module that includes a no_lingering_errors context
manager which provokes a wvtest failure if there are any saved_errors
before or after a test, and then clears them, and use that manager in
all of the Python tests so that unexpected errors will be detected
immediately, instead of causing an unrelated failure later, when testing
for expected saved_errors.

Add a temp_testdir context manager to replace all of the current
tmpdir-related boilerplate.

Rework all of the tests to use the two managers where appropriate, so
that this:

  def test_bloom():
      initial_failures = wvfailure_count()
      tmpdir = tempfile.mkdtemp(dir=bup_tmp, prefix='bup-tbloom-')
      ...
      if wvfailure_count() == initial_failures:
          subprocess.call(['rm', '-rf', tmpdir])

becomes this:

  def test_bloom():
      with no_lingering_errors(), test_tempdir('bup-tbloom-') as tmpdir:
          ...

While making the changes, clean up the imports to match the PEP 8 import
recommendations a bit more closely (excepting the suggestion to avoid
"import bar, baz", which seems odd given the blessing of "from foo
import bar, baz", where bar and baz could still be modules).

Thanks to Tadej Janež for reporting the initial issue.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
8 years agotest_server_split_with_indexes: close packwriter
Rob Browning [Sat, 26 Mar 2016 23:40:57 +0000 (18:40 -0500)]
test_server_split_with_indexes: close packwriter

Otherwise there are random test failures when the tmpdir is removed
before the PackWriter's destructor calls close().  This doesn't cause an
immediate problem, but it adds an unexpected entry to saved_errors that
causes later tests to fail.

The related saved_errors entries looked like this:

  ['../../../bup', 'midx', '--auto', '--dir', ...]: returned 15

and the underlying (hidden) midx stderr output in that case looked like
this:

  error: '...' is not a bup repository; run "bup init"

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
8 years agotest-rm: replace pipefail with explicit tests
Rob Browning [Sat, 26 Mar 2016 15:19:24 +0000 (10:19 -0500)]
test-rm: replace pipefail with explicit tests

...and fix some missing or ineffective status checks.

Thanks to Greg Troxel for reporting the problem.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.
8 years agosync-trees: drop -X and retry if -X fails
Rob Browning [Tue, 22 Mar 2016 05:13:14 +0000 (00:13 -0500)]
sync-trees: drop -X and retry if -X fails

It appears that rsync may fail if -X is specified and the filesystem
doesn't support xattrs.

Thanks to Greg Troxel for reporting the problem and helping test the
solution.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
8 years agocompare-trees: drop -X and retry if -X fails
Rob Browning [Sat, 27 Feb 2016 20:07:41 +0000 (14:07 -0600)]
compare-trees: drop -X and retry if -X fails

It appears that rsync may fail, even during a --dry-run, if -X is
specified and the filesystem doesn't support xattrs.

Thanks to Greg Troxel for reporting the problem and helping test the
solution.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
8 years agofuse: remove redundant custom Stat class
Rob Browning [Sun, 28 Feb 2016 16:21:57 +0000 (10:21 -0600)]
fuse: remove redundant custom Stat class

It looks like our Stat class was just reinitializing all of the things
that the built in fuse.Stat class already initializes, so just rely on
theirs, and use their keyword initializers to avoid a few more
reinitializations.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
8 years agofuse: add --verbose argument and use it
Rob Browning [Sun, 28 Feb 2016 16:14:46 +0000 (10:14 -0600)]
fuse: add --verbose argument and use it

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
8 years agoweb: retrieve paths exactly as presented
Rob Browning [Sat, 6 Feb 2016 18:02:58 +0000 (12:02 -0600)]
web: retrieve paths exactly as presented

Bup paths are byte strings, not Unicode, so don't attempt to convert
them to Unicode.  Retrieve exactly what was requested.

Thanks to Mathieu Schroeter for reporting the problem and helping test
the fix.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
8 years agoMerge web GET fix and SIGTERM and unix:// support
Rob Browning [Sat, 12 Mar 2016 17:55:05 +0000 (11:55 -0600)]
Merge web GET fix and SIGTERM and unix:// support

Tested-by: Rob Browning <rlb@defaultvalue.org>
Signed-off-by: Rob Browning <rlb@defaultvalue.org>
8 years agoweb: fix broken GETs and test
Rob Browning [Sat, 12 Mar 2016 17:45:08 +0000 (11:45 -0600)]
web: fix broken GETs and test

It appears that content GETs, i.e. "curl
http://localhost/foo/latest/bar" may have been broken for a while.  To
addresss that, switch to the apparently preferred upstream coroutine
approach, and add some initial tests.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
8 years agoweb: add missing chunkyreader import
Rob Browning [Sat, 5 Mar 2016 23:56:06 +0000 (17:56 -0600)]
web: add missing chunkyreader import

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
8 years agoweb: for unix://path, listen on filesystem socket
Rob Browning [Sat, 5 Mar 2016 23:09:16 +0000 (17:09 -0600)]
web: for unix://path, listen on filesystem socket

Add support for filesystem sockets.  If nothing else, this is very
useful for testing.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
8 years agoweb: attempt orderly shut down on SIGTERM
Rob Browning [Sat, 5 Mar 2016 22:56:03 +0000 (16:56 -0600)]
web: attempt orderly shut down on SIGTERM

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
8 years agoweb: remove unneeded __name__ == '__main__' guard
Rob Browning [Sat, 5 Mar 2016 22:49:36 +0000 (16:49 -0600)]
web: remove unneeded __name__ == '__main__' guard

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
8 years agobup-index.md: fix path ref; update description
Rob Browning [Mon, 18 Jan 2016 00:53:18 +0000 (18:53 -0600)]
bup-index.md: fix path ref; update description

Change one more "filename" to "path", and adjust the initial
description.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
8 years agoNever omit explicitly named mounts during index -x
Rob Browning [Sun, 10 Jan 2016 19:44:04 +0000 (13:44 -0600)]
Never omit explicitly named mounts during index -x

Assuming mounts like this:

  /
  /usr

and an index invocation like "bup index -x / /usr", don't skip indexing
/usr.  Previously bup would skip /usr when -x was specified because
reduce_paths() would drop /usr from the list of paths to index, assuming
that /usr would be covered when indexing /.  However, when /usr was
actually reached, -x would cause it to be skipped.

To fix that, exempt all mount points mentioned on the command line from
-x during filesystem traversal, expand the (root only) tests to cover
this situation, and check some corner cases.

Thanks to Wayne Scott for reporting the problem, and Yves-Alexis Perez
for a reminder.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
8 years agoindex: raise children_n limit to struct 'I' max
Rob Browning [Sat, 5 Mar 2016 17:21:50 +0000 (11:21 -0600)]
index: raise children_n limit to struct 'I' max

This assertion appears to be a sanity check, and one that's perhaps too
low (think giant Maildirs), so raise it to the real limit, which should
be UINT_MAX, given that the index header containing it is
encoded/decoded via 'I' (platform native unsigned int):

  https://docs.python.org/2/library/struct.html

Since Python doesn't appear to provide access to UINT_MAX, add it (and
INT_MAX) to _helpers.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>