]> arthur.barton.de Git - bup.git/log
bup.git
10 years agoAdd initial support for ls(1) style "-d" argument to "bup ls".
Rob Browning [Sat, 22 Mar 2014 05:20:20 +0000 (00:20 -0500)]
Add initial support for ls(1) style "-d" argument to "bup ls".

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agoindex.py: fix typo in Writer._add.
Rob Browning [Thu, 3 Apr 2014 18:20:45 +0000 (13:20 -0500)]
index.py: fix typo in Writer._add.

Thanks to bk <b.karran@gmail.com> for reporting the problem.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agoindex-cmd: prevent a division by zero while computing paths_per_second.
Patryck Rouleau [Mon, 31 Mar 2014 01:21:31 +0000 (21:21 -0400)]
index-cmd: prevent a division by zero while computing paths_per_second.

Signed-off-by: Patryck Rouleau <prouleau72@gmail.com>
Reviewed-by: Rob Browning <rlb@defaultvalue.org>
10 years agot/tmetadata.py: accommodate changes to xattr.set error message.
Mark J Hewitt [Fri, 28 Mar 2014 14:46:18 +0000 (14:46 +0000)]
t/tmetadata.py: accommodate changes to xattr.set error message.

Correct the expected error string for xattr.set (changed in
21eab6b52fcf65827e21ca33fd3349157993053c).

Signed-off-by: Mark J Hewitt <m.hewitt@computer.org>
[rlb@defaultvalue.org: adjust commit message, and include a leading
 single quote in what we're looking for, to match
 c8c1f0341c82f4abf4d3f8eed1fe4ddfa4a48493.]
Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agot/test-meta.sh: fix xattr.set test broken by path output on error.
Rob Browning [Wed, 26 Mar 2014 23:47:59 +0000 (18:47 -0500)]
t/test-meta.sh: fix xattr.set test broken by path output on error.

This was broken by 21eab6b52fcf65827e21ca33fd3349157993053c, and I
(obviously) didn't test as root before pushing.

Thanks to Mark J Hewitt <mjh@idnet.com> for the report.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agoPass any VFS Dir() constructor keywords on to Node().
Rob Browning [Sat, 22 Mar 2014 18:44:55 +0000 (13:44 -0500)]
Pass any VFS Dir() constructor keywords on to Node().

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agowvtest.sh: add WVDIE().
Rob Browning [Sat, 22 Mar 2014 19:32:17 +0000 (14:32 -0500)]
wvtest.sh: add WVDIE().

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agometadata.py: xattr exception strings don't have path information; add it.
Rob Browning [Sun, 23 Mar 2014 16:19:31 +0000 (11:19 -0500)]
metadata.py: xattr exception strings don't have path information; add it.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agotest-ls.sh: don't check the symlink file size on NetBSD for now.
Rob Browning [Sun, 23 Mar 2014 15:39:25 +0000 (10:39 -0500)]
test-ls.sh: don't check the symlink file size on NetBSD for now.

NetBSD appears to be returning varying file sizes for symlinks at the
moment, so just ignore the size there for now.

Thanks to Thomas Klausner <tk@giga.or.at> for reporting the problem
and to him and Greg Troxel <gdt@ir.bbn.com> for help with the
workaround.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agotest-ls.sh: get the group and gid from the filesystem.
Rob Browning [Sat, 22 Mar 2014 15:25:32 +0000 (10:25 -0500)]
test-ls.sh: get the group and gid from the filesystem.

Get the expected gid from the filesystem, not "id", because on some
platforms (BSDs, etc.) a new path's gid is taken from the parent
directory, not the effective gid.

Thanks to Thomas Klausner <tk@giga.or.at> for reporting the problem
and to him and Greg Troxel <gdt@ir.bbn.com> for helping craft the
solution.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years ago_helpers.c: use "unsigned long long" in ASSIGN_PYLONG_TO_INTEGRAL().
Rob Browning [Fri, 21 Mar 2014 20:13:27 +0000 (15:13 -0500)]
_helpers.c: use "unsigned long long" in ASSIGN_PYLONG_TO_INTEGRAL().

The result of PyLong_AsUnsignedLongLong() was being assigned to an
"unsigned long".  Don't do that.

Thanks to Alexander Barton <alex@barton.de> for reporting the problem.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agowvtest.sh: print a backtrace on failure when running under bash.
Rob Browning [Thu, 20 Mar 2014 18:52:06 +0000 (13:52 -0500)]
wvtest.sh: print a backtrace on failure when running under bash.

Very handy when there are nested WV* calls, i.e.

  foo() { ... WVPASS bar; ... }
  ...
  WVPASS foo

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agowvtest.sh: declare non-global variables to be local.
Rob Browning [Thu, 20 Mar 2014 15:29:43 +0000 (10:29 -0500)]
wvtest.sh: declare non-global variables to be local.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agoReport paths/s in index progress information.
Rob Browning [Sat, 15 Feb 2014 02:52:30 +0000 (20:52 -0600)]
Report paths/s in index progress information.

Tested-by: Alexander Barton <alex@barton.de>
Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agoUse "EXAMPLES" consistently in the manpages.
Rob Browning [Thu, 20 Mar 2014 22:01:20 +0000 (17:01 -0500)]
Use "EXAMPLES" consistently in the manpages.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agowvtest.sh: add "Local Variables" for file's current code style.
Rob Browning [Thu, 20 Mar 2014 15:22:18 +0000 (10:22 -0500)]
wvtest.sh: add "Local Variables" for file's current code style.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agowvtest.sh: remove unused LVL variable.
Rob Browning [Thu, 20 Mar 2014 15:18:22 +0000 (10:18 -0500)]
wvtest.sh: remove unused LVL variable.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agoDisable -Wtautological-compare for INTEGER_TO_PY() calls for clang.
Rob Browning [Tue, 18 Mar 2014 16:19:41 +0000 (11:19 -0500)]
Disable -Wtautological-compare for INTEGER_TO_PY() calls for clang.

Without this, INTEGER_TO_PY() produces clang errrors like this on some
platforms:

  _helpers.c:1019:41: error: comparison of unsigned expression >= 0 is always true
  [-Werror,-Wtautological-compare]
                           (((st->st_uid) >= 0) ? PyLong_FromUnsignedLongLong(st->st_uid) :
  PyLong_FromLongLong(st->st_uid)),
                             ~~~~~~~~~~~~ ^  ~

Thanks to Greg Troxel <gdt@lexort.com> for the report.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agotest-on.sh: add some simple "bup on" tests.
Rob Browning [Mon, 17 Mar 2014 17:59:12 +0000 (12:59 -0500)]
test-on.sh: add some simple "bup on" tests.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agotest-ls.sh: take only the first 10 chars from ls -l's mode string.
Rob Browning [Tue, 18 Feb 2014 18:30:31 +0000 (12:30 -0600)]
test-ls.sh: take only the first 10 chars from ls -l's mode string.

Since ls -l's mode string may not be separated from the next field by
a space (i.e. when ACLs, etc. are involved), take only the first 10
characters for now when retrieving the symlink mode string (cf.
30d9027cc5444f038d38927219dc59e3b69fa219).

Thanks to Mark J Hewitt <mjh@idnet.com> for pointing out the problem
and testing the solution.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agotest-compression.sh: use "tar ... | wc -c" instead of du.
Rob Browning [Mon, 17 Feb 2014 18:39:05 +0000 (12:39 -0600)]
test-compression.sh: use "tar ... | wc -c" instead of du.

This test was failing on a ZFS system with compression enabled because
du wasn't summing the actual file sizes.  To fix that, use tar/wc so
that we'll calculate the actual tree size without having to worry
about the portability of du's --apparent-size argument.

Thanks to Björn Seifert <seifert@oern.de> for reporting the problem
and Greg Troxel <gdt@lexort.com> for suggesting this fix.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agotest-ls.sh: get the symlink mode from the host ls; test for subcmd failure.
Rob Browning [Mon, 17 Feb 2014 18:22:58 +0000 (12:22 -0600)]
test-ls.sh: get the symlink mode from the host ls; test for subcmd failure.

This should fix a failure on OS X where symlinks don't have a
"rwxrwxrwx" mode like they do on Linux.

Thanks to Sashka Will <will.sashka@gmail.com> for the report.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agoAdd acl and attr to Debian/Ubuntu build deps and default to python-2.7.
Dmitry Polushkin [Tue, 11 Feb 2014 01:50:47 +0000 (01:50 +0000)]
Add acl and attr to Debian/Ubuntu build deps and default to python-2.7.

This fixes a "make test" failure on Ubuntu 12.04.

Signed-off-by: Dmitry Polushkin <dmitry.polushkin@gmail.com>
[rlb@defaultvalue.org: adjust commit message; fix trailing whitespace.]

10 years agoAlways return a level 0 blob from _splitbuf() for BLOB_MAX sized blobs.
Aidan Hobson Sayers [Sat, 23 Nov 2013 17:23:04 +0000 (17:23 +0000)]
Always return a level 0 blob from _splitbuf() for BLOB_MAX sized blobs.

Previously if _splitbuf() returned an offset anywhere in the buffer we
would always use the 'level' of the offset for the resulting blob.  So
when the offset was greater than BLOB_MAX, we'd still use the offset's
level, even though we'd be returning a blob that didn't reach that
offset.  In some cases, this could cause bup to generate a sequence of
BLOB_MAX sized blobs, each in their own own chunk group.

To fix that, set the level of all BLOB_MAX sized blobs to 0, which
makes those blobs behave just as they would have before this patch,
whenever they were found at the end of the buffer.

Test the new behavior -- the last two of these four new tests will
fail if run before the changes, as they check that blobs split by
enforcing BLOB_MAX do not 'inherit' the value of level from a split
later in the buffer.

Signed-off-by: Aidan Hobson Sayers <aidanhs@cantab.net>
[rlb@defaultvalue.org: squash tests commit into _splitbuf() changes commit;
 adjust commit message.]
Reviewed-by: Rob Browning <rlb@defaultvalue.org>
10 years agosave-cmd.py, split-cmd.py: end the commit message with a newline.
Rob Browning [Fri, 14 Feb 2014 18:08:47 +0000 (12:08 -0600)]
save-cmd.py, split-cmd.py: end the commit message with a newline.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agosplit-cmd.py: respect --compress for remote repos too.
Rob Browning [Wed, 12 Feb 2014 18:10:27 +0000 (12:10 -0600)]
split-cmd.py: respect --compress for remote repos too.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agoMove Client compression spec from constructor to new_packwriter().
Rob Browning [Wed, 12 Feb 2014 18:09:03 +0000 (12:09 -0600)]
Move Client compression spec from constructor to new_packwriter().

This makes remote usage match local usage, where the compression is
per-PackWriter.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agometadata.summary_str(): don't ignore a size of 0 (i.e. print "0", not "-").
Rob Browning [Thu, 6 Feb 2014 18:01:05 +0000 (12:01 -0600)]
metadata.summary_str(): don't ignore a size of 0 (i.e. print "0", not "-").

Thanks to Karl Kiniger <karl.kiniger@med.ge.com> for the report.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agotest-ls.sh: eliminate timezone dependencies; test dates in two timezones.
Rob Browning [Thu, 6 Feb 2014 00:34:32 +0000 (18:34 -0600)]
test-ls.sh: eliminate timezone dependencies; test dates in two timezones.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agoRestore ls -l item sizes, and add initial tests for them.
Rob Browning [Wed, 5 Feb 2014 20:19:12 +0000 (14:19 -0600)]
Restore ls -l item sizes, and add initial tests for them.

Thanks to Karl Kiniger <karl.kiniger@med.ge.com> for the report.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agoFix the ls -laAF options with respect to the VFS synthetic directories.
Rob Browning [Thu, 30 Jan 2014 22:26:44 +0000 (16:26 -0600)]
Fix the ls -laAF options with respect to the VFS synthetic directories.

Before this, they wouldn't work in various cases where the VFS was
creating synthetic data (like the top-level branch and commit-list
trees).

Oh, and how about some tests?

Thanks to Gabriel Filion <gabster@lelutin.ca> for reporting the
problem.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agometadata.py: add a more meaningful repr() to Metadata.
Rob Browning [Wed, 29 Jan 2014 21:27:37 +0000 (15:27 -0600)]
metadata.py: add a more meaningful repr() to Metadata.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agoAdd --exclude-rx and --exclude-rx-from support to "bup drecurse".
Rob Browning [Fri, 31 Jan 2014 00:56:05 +0000 (18:56 -0600)]
Add --exclude-rx and --exclude-rx-from support to "bup drecurse".

Thanks to nicolas.pouillard@gmail.com for the reminder.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agoFix drecurse relative --excludes, quash duplicates, and add tests.
Rob Browning [Fri, 31 Jan 2014 00:49:36 +0000 (18:49 -0600)]
Fix drecurse relative --excludes, quash duplicates, and add tests.

Previously "bup drecurse --exclude bar foo" wouldn't work because bar
would be expanded to an absolute path, but drecurse would traverse
(and attempt to match against) relative paths.

Have parse_excludes() remove duplicates and sort its result.

Add some initial drecurse tests.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agobup-index.md: remove misleading --exclude expansion comment.
Rob Browning [Fri, 31 Jan 2014 00:25:33 +0000 (18:25 -0600)]
bup-index.md: remove misleading --exclude expansion comment.

This comment was originally added in reference to some confusion over
globbing, but the text was misleading because bup does apply
realpath() to all of the --exclude paths, arguably a form of
expansion.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agovfs.py: replace "X" placeholder with the instance id in Node.__repr__().
Rob Browning [Wed, 29 Jan 2014 21:19:42 +0000 (15:19 -0600)]
vfs.py: replace "X" placeholder with the instance id in Node.__repr__().

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agogit.py: remove unused home_repodir variable.
Rob Browning [Tue, 21 Jan 2014 23:06:16 +0000 (17:06 -0600)]
git.py: remove unused home_repodir variable.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agot/test.sh: use a tmpdir in t/tmp instead of working directly in ./.
Rob Browning [Fri, 24 Jan 2014 00:15:23 +0000 (18:15 -0600)]
t/test.sh: use a tmpdir in t/tmp instead of working directly in ./.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agotmetadata.py, txstat.py: don't remove tmpdirs when tests fail.
Rob Browning [Wed, 29 Jan 2014 20:44:37 +0000 (14:44 -0600)]
tmetadata.py, txstat.py: don't remove tmpdirs when tests fail.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agotmetadata.py, txstat.py: use t/tmp as the tmpdir parent.
Rob Browning [Wed, 29 Jan 2014 20:30:54 +0000 (14:30 -0600)]
tmetadata.py, txstat.py: use t/tmp as the tmpdir parent.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agotindex.py: use a tmpdir in t/tmp instead of working directly in lib/bup/t/.
Rob Browning [Wed, 29 Jan 2014 20:15:48 +0000 (14:15 -0600)]
tindex.py: use a tmpdir in t/tmp instead of working directly in lib/bup/t/.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agotclient.py: use a tmpdir in t/tmp instead of working directly in lib/bup/t/.
Rob Browning [Wed, 29 Jan 2014 20:04:14 +0000 (14:04 -0600)]
tclient.py: use a tmpdir in t/tmp instead of working directly in lib/bup/t/.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agosave-cmd.py: disallow backup set names containing "/".
Rob Browning [Mon, 27 Jan 2014 20:51:47 +0000 (14:51 -0600)]
save-cmd.py: disallow backup set names containing "/".

There's no way to refer to them via the VFS, because the VFS (as
expected) treats all forward slashes as path separators.

Before this change, it was possible to create backup sets with names
like "x/y/z" that were inaccessible via ls, restore, etc.

Thanks to Laura Morrissey <laura.morrissey@gmail.com> for the report.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agotbloom.py: use a tmpdir in t/tmp instead of working directly in lib/bup/t/.
Rob Browning [Sat, 25 Jan 2014 21:59:08 +0000 (15:59 -0600)]
tbloom.py: use a tmpdir in t/tmp instead of working directly in lib/bup/t/.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agoChange -x/--xdev/--one-filesystem to include the mount point itself.
Rob Browning [Tue, 24 Dec 2013 02:10:49 +0000 (20:10 -0600)]
Change -x/--xdev/--one-filesystem to include the mount point itself.

Match rsync, tar, etc., and add and use t/cleanup-mounts-under to
clean up all temporary mounts under t/mnt and t/tmp.

Thanks to Karl Kiniger <karl.kiniger@med.ge.com> for the report.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Karl Kiniger <karl.kiniger@med.ge.com>
10 years agotgit.py: use a tmpdir in t/tmp instead of working directly in lib/bup/t/.
Rob Browning [Fri, 24 Jan 2014 03:01:41 +0000 (21:01 -0600)]
tgit.py: use a tmpdir in t/tmp instead of working directly in lib/bup/t/.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agometadata.py: remove obsolete comments.
Rob Browning [Thu, 23 Jan 2014 22:55:18 +0000 (16:55 -0600)]
metadata.py: remove obsolete comments.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agoMention par2 as one of the reasons you might want to avoid bup.
Rob Browning [Fri, 17 Jan 2014 20:00:04 +0000 (14:00 -0600)]
Mention par2 as one of the reasons you might want to avoid bup.

(i.e. add it to the informal list of requirements)

Thanks to James Lott <james@lottspot.com> for the suggestion.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agobup-restore.md: always initialize root_meta in do_root.
itxx00 [Wed, 8 Jan 2014 05:14:26 +0000 (13:14 +0800)]
bup-restore.md: always initialize root_meta in do_root.

Previously, using bup split with bup restore would cause an error:

  UnboundLocalError: local variable 'root_meta' referenced before assignment

Signed-off-by: itxx00 <itxx00@gmail.com>
[rlb@defaultvalue.org: adjust commit message.  Initialize root_meta
 unconditionally before guard to match other code.]
Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agobup-join.md bup-save.md: note that even with "-r" a local repo is required.
Rob Browning [Sun, 12 Jan 2014 22:20:31 +0000 (16:20 -0600)]
bup-join.md bup-save.md: note that even with "-r" a local repo is required.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agoCheck for overflow when converting from Python to unsigned integer types.
Rob Browning [Tue, 3 Dec 2013 18:37:53 +0000 (12:37 -0600)]
Check for overflow when converting from Python to unsigned integer types.

Python's PyArg_ParseTuple() unsigned integer type conversions don't
check for overflow, so stop using them.  Add bup_uint_from_py(),
bup_ulong_from_py(), and bup_ullong_from_py() functions that do check,
and use them instead.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agoMove the main fsck tests from test.sh to test-fsck.sh.
Rob Browning [Tue, 31 Dec 2013 19:58:53 +0000 (13:58 -0600)]
Move the main fsck tests from test.sh to test-fsck.sh.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agoMove clear-index tests from test.sh to test-index-clear.sh.
Rob Browning [Tue, 31 Dec 2013 18:58:49 +0000 (12:58 -0600)]
Move clear-index tests from test.sh to test-index-clear.sh.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agoMove test.sh exclude tests to renamed test-save-restore-excludes.sh.
Rob Browning [Tue, 31 Dec 2013 18:48:14 +0000 (12:48 -0600)]
Move test.sh exclude tests to renamed test-save-restore-excludes.sh.

Rename test-save-restore-exclude-rx.sh to
test-save-restore-excludes.sh, and move test.sh exclude tests there.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agoMove compression tests from test.sh to test-compression.sh.
Rob Browning [Tue, 31 Dec 2013 18:33:39 +0000 (12:33 -0600)]
Move compression tests from test.sh to test-compression.sh.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agoMove import-rdiff-backup tests from test.sh to test-import-rdiff-backup.sh.
Rob Browning [Tue, 31 Dec 2013 18:04:51 +0000 (12:04 -0600)]
Move import-rdiff-backup tests from test.sh to test-import-rdiff-backup.sh.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agoMove save --strip/--graft tests from test.sh to test-save-strip-graft.sh.
Rob Browning [Tue, 31 Dec 2013 17:35:21 +0000 (11:35 -0600)]
Move save --strip/--graft tests from test.sh to test-save-strip-graft.sh.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agoDon't require non-negative timespec ns; fix stat timestamp conversions.
Rob Browning [Thu, 19 Dec 2013 04:16:44 +0000 (22:16 -0600)]
Don't require non-negative timespec ns; fix stat timestamp conversions.

Previously we required that the system timespec tv_nsec values be
non-negative -- stop that.  POSIX doesn't specify, and there's no real
need for us to care, since all significant timestamp manipulations are
now handled as integer nanosecond values, not (sec, ns) pairs.

Change stat_struct_to_py() (used by bup_stat()/bup_lstat()) to use
INTEGER_TO_PY() to convert the timestamp st_atime/st_mtime/st_ctime
values so that we don't have to care about the sign/size of the
underlying type (which should be time_t).

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agoRemove ancient lib/tornado in favor of an external dependency.
Rob Browning [Thu, 26 Dec 2013 20:01:12 +0000 (14:01 -0600)]
Remove ancient lib/tornado in favor of an external dependency.

Our lib/tornado dates from over three years ago -- drop it in favor of
an external dependency, and update the install instructions
accordingly.

Anyone trying to run "bup web" without tornado installed will see
this:

  error: cannot find the python "tornado" module; please install it

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agoAlways publish (l)utimes in helpers when available and fix type conversions.
Rob Browning [Wed, 18 Dec 2013 03:12:06 +0000 (21:12 -0600)]
Always publish (l)utimes in helpers when available and fix type conversions.

Previously, bup assumed a timeval was (long, long), which agrees with
glibc.info and (Linux) utimes(2), but POSIX says it's (time_t,
suseconds_t).

Since the types vary (and even if they didn't, Python doesn't provide
safe "time_t" conversions), handle the type conversions more
generically, via ASSIGN_PYLONG_TO_INTEGRAL() and
INTEGRAL_ASSIGNMENT_FITS().

Optimistically assume the latter is sufficient for tv_usec (where we
convert it to a long long) because POSIX guarantees that tv_usec will
be a signed integral.

Whenever available, publish utimes and lutimes independently in
helpers, and run the relevant t/txstat.py tests.  So now, we'll be
running at least some tests on utimensat, lutimes, and utimes whenever
they're available.

A more significant improvement would be to run some broader bup tests
twice, once with utimensat and once with utimes/lutimes, whenever both
are available.

cf. 9ce545703dda3c888081c504863308902ce8c56b

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agoRemove vestigial and inappropriate isnan()/isinf() timestamp tests.
Rob Browning [Sat, 28 Dec 2013 18:18:51 +0000 (12:18 -0600)]
Remove vestigial and inappropriate isnan()/isinf() timestamp tests.

I'm fairly sure this is an historical accident, but regardless, remove
the (my) obviously inappropriate floating point tests on integer
values from bup_parse_xutime_args().  Nothing to see here -- move
along.

I've broken this change out from a larger post-0.25 patch, where I'd
already fixed it, so that it'll be easy to pull into stable if we
like.

Thanks to Ed Maste <carpeddiem@gmail.com> for reporting the problem
(which prompted me to go ahead and create the separate fix).

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agoAdd -n, -A, -F, --file-type, --numeric-ids and detailed -l to "bup ls".
Rob Browning [Tue, 24 Dec 2013 21:34:44 +0000 (15:34 -0600)]
Add -n, -A, -F, --file-type, --numeric-ids and detailed -l to "bup ls".

With the addition of -A, change -a to behave more conventionally,
i.e. to show "." and "..".

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Alexander Barton <alex@barton.de>
Reviewed-By: Zoran Zaric <zz@zoranzaric.de>
[rlb@defaultvalue.org: fall back to n.mode when n.metadata() isn't
 available in node_info() so that CommitDirs ("ls -AF /"), etc. will
 still work; thanks to Gabriel Filion <gabster@lelutin.ca> for the
 report; fix the rdiff-backup test to use -A.]
Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agoAlways publish utimensat in helpers when available and fix type conversions.
Rob Browning [Wed, 18 Dec 2013 02:56:52 +0000 (20:56 -0600)]
Always publish utimensat in helpers when available and fix type conversions.

Previously, bup assumed a timespec was (long, long), which agrees with
glibc.info, but utimensat(2) and POSIX say it's (time_t, long).

Since the types vary (and even if they didn't, Python doesn't provide
safe "time_t" conversions), add ASSIGN_PYLONG_TO_INTEGRAL(), which
should handle safely assigning a PyLong value to any given C integral
destination, whenever it will fit -- then use that macro to handle the
utimensat arguments.

Whenever it's available, publish utimensat independently in helpers.
For now, this allows us to test utimensat directly, and in the future,
it may allow us to test bup's behavior with either utimensat or
utimes/lutimes without recompilation, whenever both are available.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agoDon't fail tests when the timestamp read resolution is higher than write.
Rob Browning [Wed, 18 Dec 2013 02:19:44 +0000 (20:19 -0600)]
Don't fail tests when the timestamp read resolution is higher than write.

Previously, if bup was able to read path timestamps at a higher
resolution than it could write them, tests would fail.  This situation
can occur (for example) when the stat() resolution is 1ns, but either
the underlying filesystem's isn't, or bup wasn't able to find
utimensat at build time.

To fix this, compute the maximum resolution of the test filesystem
(via "t/ns-timestamp-resolutions HERE"), and then limit the "bup
xstat" timestamp resolution in the tests to match via a new
--mtime-resolution argument.

For completeness, also add --atime-resolution and --ctime-resolution
arguments.

Thanks to Tim Riemenschneider <t.riemenschneider@detco.de> for
reporting the problem.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agoAdd restore option "--exclude-rx-from FILE".
Rob Browning [Fri, 20 Dec 2013 23:43:08 +0000 (17:43 -0600)]
Add restore option "--exclude-rx-from FILE".

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agoAdd simple test for "index --exclude-rx-from FILE".
Rob Browning [Fri, 20 Dec 2013 23:26:11 +0000 (17:26 -0600)]
Add simple test for "index --exclude-rx-from FILE".

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agoMove the --exclude-rx tests from test.sh to test-save-restore-exclude-rx.sh.
Rob Browning [Fri, 20 Dec 2013 23:15:30 +0000 (17:15 -0600)]
Move the --exclude-rx tests from test.sh to test-save-restore-exclude-rx.sh.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agoAdd index option "--exclude-rx-from FILE".
Thomas Klausner [Fri, 20 Dec 2013 16:53:51 +0000 (17:53 +0100)]
Add index option "--exclude-rx-from FILE".

Signed-off-by: Thomas Klausner <tk@giga.or.at>
[rlb@defaultvalue.org: adjust commit message; change "path" to
 "pattern" in bup-index.md description; adjust bup-index.md text;
 adjust optspec text.]
Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agoStop testing negative timestamps -- they're not necessarily valid.
Rob Browning [Thu, 19 Dec 2013 02:19:19 +0000 (20:19 -0600)]
Stop testing negative timestamps -- they're not necessarily valid.

Both timevals and timespecs use a time_t for the seconds which POSIX
requires to be an "integer or real-floating type", so unsigned integer
types are perfectly valid.  (See FUSE for example -- though it's not
even using a time_t; at the moment it's just using uint64_t...).

Thanks to Tim Riemenschneider <t.riemenschneider@detco.de> for
reporting the problem.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agoRequire utimensat or utimes/lutimes.
Rob Browning [Mon, 16 Dec 2013 02:30:46 +0000 (20:30 -0600)]
Require utimensat or utimes/lutimes.

This was already true (tests would fail), so make it explicit, and if
we do encounter any platforms where none of these functions are
available, we can worry about it then.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agoHACKING: update to reflect 0.25 release.
Rob Browning [Wed, 18 Dec 2013 21:37:20 +0000 (15:37 -0600)]
HACKING: update to reflect 0.25 release.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agoUpdate README.md for 0.25. 0.25 0.25-rc5
Rob Browning [Sat, 23 Nov 2013 18:32:55 +0000 (12:32 -0600)]
Update README.md for 0.25.

Among other things, shift emphasis to index/save/restore over
split/join.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agoid-other-than: exclude names based on their underlying ids.
Rob Browning [Tue, 10 Dec 2013 01:00:57 +0000 (19:00 -0600)]
id-other-than: exclude names based on their underlying ids.

This fixes a failure on systems that have more than one one user/group
name mapped to the same id (i.e. NetBSD's root/toor accounts).

Thanks to Thomas Klausner <tk@giga.or.at> for reporting the problem
and helping track down the solution.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agot/test-meta.sh: handle systems that have sgid directories.
Rob Browning [Fri, 6 Dec 2013 16:18:37 +0000 (10:18 -0600)]
t/test-meta.sh: handle systems that have sgid directories.

Explicitly chown the test directory to a group we're in so that the
tests will work on systems that have sgid directories by default
(i.e. NetBSD, etc.).

Thanks to Thomas Klausner <tk@giga.or.at> for reporting the problem
and helping track down the solution.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agotmetadata.py: chmod tree before deletion to fix NetBSD test failure.
Thomas Klausner [Fri, 6 Dec 2013 00:08:01 +0000 (01:08 +0100)]
tmetadata.py: chmod tree before deletion to fix NetBSD test failure.

Apparently NetBSD won't let you recursively delete a parent directory
containing a 000 subdirectory, so "chmod -R u+rwX" the tree first.

Signed-off-by: Thomas Klausner <tk@giga.or.at>
[rlb@defaultvalue.org: adjust commit message.]
Reviewed-by: Rob Browning <rlb@defaultvalue.org>
10 years agoAdd helpers.fdatasync(); fix interleaved mmap/read-write in midx.
Rob Browning [Tue, 3 Dec 2013 18:39:37 +0000 (12:39 -0600)]
Add helpers.fdatasync(); fix interleaved mmap/read-write in midx.

Have helpers.fdatasync() fall back to os.fsync() whenever
os.fdatasync() isn't available.

Thanks to Yann Autissier <yann.autissier@gmail.com> for reporting the
problem that prompted this work.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agoRemove t/ from the test-meta.sh test tree now that it contains t/tmp/.
Rob Browning [Wed, 4 Dec 2013 17:14:00 +0000 (11:14 -0600)]
Remove t/ from the test-meta.sh test tree now that it contains t/tmp/.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agoCreate t/force-delete from t/lib.sh force-delete and use it everywhere.
Rob Browning [Tue, 3 Dec 2013 20:17:26 +0000 (14:17 -0600)]
Create t/force-delete from t/lib.sh force-delete and use it everywhere.

Move the t/lib.sh force-delete code to t/force-delete as a standalone
command, and use it everywhere -- particularly to delete t/tmp during
"make clean", given the recent move to run all tests inside t/ via
TMPDIR (18f838c9a66d521f9fa042eead3c5771ca99b03a).

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agoDon't compute local script_home in lib.sh realpath (depended on pwd).
Rob Browning [Tue, 3 Dec 2013 19:49:41 +0000 (13:49 -0600)]
Don't compute local script_home in lib.sh realpath (depended on pwd).

Compute bup_t_lib_script_home once at load time so that it won't be
affected by changes to pwd, and use it in realpath.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agoUse the correct types when calling FS_IOC_GETFLAGS/FS_IOC_SETFLAGS.
Aurelien Jarno [Thu, 28 Nov 2013 18:36:16 +0000 (12:36 -0600)]
Use the correct types when calling FS_IOC_GETFLAGS/FS_IOC_SETFLAGS.

Despite the definitions in <linux/fs.h> these ioctls take int
arguments, not longs. This is important for 64-bit big endian
machines.

See http://marc.info/?l=linux-fsdevel&m=138552482917220&w=2

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
[rlb@defaultvalue.org: adjust commit message; use "I" conversion
 to/from Python instead of "k".]
Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agoDon't check ACLs in t/compare-trees on NetBSD.
Rob Browning [Mon, 25 Nov 2013 20:31:28 +0000 (14:31 -0600)]
Don't check ACLs in t/compare-trees on NetBSD.

Treat NetBSD like Cygwin and Darwin (OS X) in t/compare-trees.  This
should finish the process of disabling POSIX ACL support on NetBSD
that was started here: 349ff15c7db09883abc20bdf3e8a4df6bff12cd3.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agoRevert "Don't check ACLs in t/compare-trees on FreeBSD."
Rob Browning [Mon, 25 Nov 2013 20:27:25 +0000 (14:27 -0600)]
Revert "Don't check ACLs in t/compare-trees on FreeBSD."

This reverts commit 985b17f45707fe3759ca13f005625934f5f63b4c.

That should have been *NetBSD*.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agoDon't check ACLs in t/compare-trees on FreeBSD.
Rob Browning [Sun, 24 Nov 2013 18:05:00 +0000 (12:05 -0600)]
Don't check ACLs in t/compare-trees on FreeBSD.

Treat FreeBSD like Cygwin and Darwin (OS X) in t/compare-trees.  This
should finish the process of disabling POSIX ACL support on FreeBSD
that was started here: 349ff15c7db09883abc20bdf3e8a4df6bff12cd3.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agoFix off-by-one in MAX_PER_TREE guard in _squish().
Rob Browning [Sat, 23 Nov 2013 19:15:45 +0000 (13:15 -0600)]
Fix off-by-one in MAX_PER_TREE guard in _squish().

Previously bup would allow MAX_PER_TREE + 1 items in a tree.  Change
the guard to ensure that trees really are limited to MAX_PER_TREE.

Thanks to Patrick Rouleau <prouleau72@gmail.com> for reporting the
problem.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agoEnforce MAX_PER_TREE by always _squish()ing in spit_to_shalist().
Rob Browning [Wed, 20 Nov 2013 20:57:53 +0000 (14:57 -0600)]
Enforce MAX_PER_TREE by always _squish()ing in spit_to_shalist().

Previously bup would ignore MAX_PER_TREE whenever it hit a long run of
data that didn't produce a non-zero hashplit "level" (see the
discussion of fanout in DESIGN).  That can happen, for example, when
traversing a file containing large zero regions (sparse or not).

As a result, bup could produce an arbitrarily large number of blobs at
level 0 of the hashsplit tree, causing it to consume increasing memory
during split/save, and to behave badly during join/restore.

To fix that, don't try to outsmart _squish() -- just call it every
time, and let it enforce MAX_PER_TREE when appropriate.

Thanks to trebor <robert.rebstock@tempelhof-projekt.de> for reporting
the problem a long while back, Yung-Chin Oei <yungchin@yungchin.nl>
for tracking down the cause and proposing a slightly different fix,
and Aidan Hobson Sayers <aidanphs@gmail.com> for suggesting this
particular approach.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agoRemove redundant *bits assignment in bupsplit_find_ofs().
Rob Browning [Wed, 20 Nov 2013 04:18:18 +0000 (22:18 -0600)]
Remove redundant *bits assignment in bupsplit_find_ofs().

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agoDESIGN: fix typo.
Rob Browning [Tue, 19 Nov 2013 19:11:51 +0000 (13:11 -0600)]
DESIGN: fix typo.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agoCompletely disable ACL support on NetBSD for now.
Thomas Klausner [Sat, 16 Nov 2013 02:05:17 +0000 (03:05 +0100)]
Completely disable ACL support on NetBSD for now.

Signed-off-by: Thomas Klausner <tk@giga.or.at>
[rlb@defaultvalue.org: adjust commit message; wrap code.]
Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agometadata.py: fix incorrectly indented line in Writer._add().
Rob Browning [Tue, 19 Nov 2013 16:29:08 +0000 (10:29 -0600)]
metadata.py: fix incorrectly indented line in Writer._add().

Thanks to Patrick Rouleau <prouleau72@gmail.com> for reporting the
problem.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agometadata.py: fix variable access in Writer.add(); tmax -> self.tmax.
Rob Browning [Sun, 17 Nov 2013 17:13:04 +0000 (11:13 -0600)]
metadata.py: fix variable access in Writer.add(); tmax -> self.tmax.

Thanks to Patrick Rouleau <prouleau72@gmail.com> for reporting the
problem.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agoManually set TMPDIR to $(CURDIR)/tmp for all tests for now.
Rob Browning [Sat, 16 Nov 2013 23:38:57 +0000 (17:38 -0600)]
Manually set TMPDIR to $(CURDIR)/tmp for all tests for now.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agoMakefile: simplify runtests-python since metadata tests aren't conditional.
Rob Browning [Fri, 15 Nov 2013 20:23:12 +0000 (14:23 -0600)]
Makefile: simplify runtests-python since metadata tests aren't conditional.

Since the metadata tests are no longer conditional, revert
runtests-python to the simpler implementation.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agoDon't crash; defer an error when a path changes while indexing it. 0.25-rc4
Rob Browning [Tue, 12 Nov 2013 17:38:35 +0000 (11:38 -0600)]
Don't crash; defer an error when a path changes while indexing it.

Mirror the error handling already used by save.

With this change the result for a path that changes or is deleted
between the drecurse traversal and the from_path() call should be the
same as the result for a path that changes or is deleted between index
and save.

Thanks to Yann Autissier <yann.autissier@gmail.com> for reporting the
problem and Gabriel Filion <gabster@lelutin.ca> for helping figure out
the solution.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agotest.sh: accommodate platforms where root defaults to "ls -A" again.
Rob Browning [Mon, 11 Nov 2013 21:41:08 +0000 (15:41 -0600)]
test.sh: accommodate platforms where root defaults to "ls -A" again.

For now just use "bup ls -a" and "ls -A", which currently match in
behavior.  Of course we'll have to change that to "bup ls -A" once we
fix "bup ls".

Thanks to Thomas Klausner <tk@giga.or.at> for the report.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agoREADME.md: change python-dev to python-devel for CentOS.
Rob Browning [Mon, 11 Nov 2013 19:05:56 +0000 (13:05 -0600)]
README.md: change python-dev to python-devel for CentOS.

Thanks to Gao Yongwei <itxx00@gmail.com> for the report.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agoRevert "Makefile: avoid using -Werror with clang for now."
Rob Browning [Mon, 11 Nov 2013 18:26:04 +0000 (12:26 -0600)]
Revert "Makefile: avoid using -Werror with clang for now."

Remove the clang -Werror special case after changing the way we handle
integer conversions (9ecba738e119654b7231be08232f8c484f8b1a93).

This reverts commit 3fdd538a22eae6681df3a59c116f78c237c9ecc7.

Thanks to Thomas Klausner <tk@giga.or.at> for the report.

10 years agoAccommodate systems where paths inherit their group from the parent dir.
Rob Browning [Mon, 11 Nov 2013 18:03:25 +0000 (12:03 -0600)]
Accommodate systems where paths inherit their group from the parent dir.

Thanks to Thomas Klausner <tk@giga.or.at> for reporting the problem
and helping test the solution.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years ago_helpers.c: be smarter when converting unknown integer types to python.
Rob Browning [Sun, 10 Nov 2013 17:21:46 +0000 (11:21 -0600)]
_helpers.c: be smarter when converting unknown integer types to python.

For now assume that long long and unsigned long long are always the
the largest integer types, and convert unknown size integers to Python
via PyLong_FromUnsignedLongLong() or PyLong_FromLongLong(), depending
on the value's sign.

Thanks to Thomas Klausner <tk@giga.or.at> for reporting the problem
and helping  track down the solution.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agoOnly allow "index --clear" to clear the default index (BUP_DIR/bupindex).
Rob Browning [Fri, 8 Nov 2013 17:35:44 +0000 (11:35 -0600)]
Only allow "index --clear" to clear the default index (BUP_DIR/bupindex).

For now, disallow clearing "external" indexes.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
10 years agoMakefile: avoid using -Werror with clang for now.
Rob Browning [Sun, 10 Nov 2013 20:11:44 +0000 (14:11 -0600)]
Makefile: avoid using -Werror with clang for now.

Apparently the default compiler on OS X and FreeBSD is now clang, and
it doesn't like our CHECK_VALUE_FITS() definition.  So for now, just
don't specify -Werror when we detect clang.

Thanks to Alexander Barton <alex@barton.de>, Thomas Klausner
<tk@giga.or.at>, Sebastian Schumb <sebastian@sebastians-site.de>, and
Zoran Zaric <zz@zoranzaric.de> for reporting the problem.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Alexander Barton <alex@barton.de>