]> arthur.barton.de Git - bup.git/log
bup.git
11 years agoAdd tests for index --no-check-device, and support for t/mnt.
Rob Browning [Sun, 17 Feb 2013 03:20:50 +0000 (21:20 -0600)]
Add tests for index --no-check-device, and support for t/mnt.

Add support for t/mnt; anything mounted there will be cleaned up
during "make clean".

Thanks to Zak Wilcox <iwilcox@iwilcox.me.uk> for an earlier version of
these tests.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
11 years agoAdd index --no-check-device to the index manpage.
Rob Browning [Sun, 17 Feb 2013 04:05:24 +0000 (22:05 -0600)]
Add index --no-check-device to the index manpage.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
11 years agoAdd a --no-check-device option to bup index (cf. tar).
Zak Wilcox [Fri, 1 Jun 2012 09:10:36 +0000 (10:10 +0100)]
Add a --no-check-device option to bup index (cf. tar).

Ignore stat.st_dev when comparing files against existing index entries, like
git does without #define USE_STDEV:

  http://www.kernel.org/pub/software/scm/git/docs/v1.7.10.1/technical/racy-git.txt

See also: "info tar".

Signed-off-by: Zak Wilcox <iwilcox@iwilcox.me.uk>
[rlb@defaultvalue.org: change original --ignore-dev to --no-check-device to match tar.
 Adjust code to work with current master.
 Remove tests -- will be reintroduced shortly.]
Signed-off-by: Rob Browning <rlb@defaultvalue.org>
11 years agoIgnore artefacts from sampledata
Gabriel Filion [Sun, 17 Mar 2013 22:24:08 +0000 (18:24 -0400)]
Ignore artefacts from sampledata

9b5ae5f53e introduced the creation of some symlinks to avoid issues on
Cygwin. "make" now leaves the repository in a dirty state since we
forgot to exclude those symlinks.

The symlinks in question are products of the build/test process so we
need to avoid commiting them.

Signed-off-by: Gabriel Filion <gabster@lelutin.ca>
Reviewed-by: Rob Browning <rlb@defaultvalue.org>
11 years agoconfigure-sampledata: test -h before -e when appropriate in --clean.
Rob Browning [Sun, 17 Mar 2013 18:03:03 +0000 (13:03 -0500)]
configure-sampledata: test -h before -e when appropriate in --clean.

Use "test -h" before "test -e" for items that might be dangling
symlinks since "test -e" returns false in that case.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
11 years agoCreate symlinks in t/configure-sampledata; remove them from git.
Rob Browning [Sat, 9 Mar 2013 20:27:34 +0000 (14:27 -0600)]
Create symlinks in t/configure-sampledata; remove them from git.

Since git doesn't always handle symlinks the way bup expects (Cygwin),
don't keep them in git, create them via "t/configure-sampledata
--setup".

This also provides a place to handle anything else that falls outside
git's purview that we might want to add.

Integrate configure-sampledata into the makefile clean and all
targets.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
11 years agoAdd "set -eo pipefail" to "exclude" and "exclude-from" tests.
Rob Browning [Sun, 17 Mar 2013 17:23:32 +0000 (12:23 -0500)]
Add "set -eo pipefail" to "exclude" and "exclude-from" tests.

Don't allow non-tests to silently fail (i.e. mkdir, touch, echo, rm,
etc.).  Eventually all test code should have similar behavior.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
11 years agobup drecurse/index: allow non-directory --exclude and --exclude-from paths.
Jakob Matthes [Sun, 10 Mar 2013 18:10:38 +0000 (19:10 +0100)]
bup drecurse/index: allow non-directory --exclude and --exclude-from paths.

Previously bup only allowed directory exclusions.

Signed-off-by: Jakob Matthes <jakob.matthes@gmail.com>
Reviewed-by: Gabriel Filion <lelutin@gmail.com>
[rlb@defaultvalue.org: change test file from g to j to avoid conflict
 with subsequent "exclude-from" test; add WVPASS to mkdir so problem
 is evident; edit commit message.]
Signed-off-by: Rob Browning <rlb@defaultvalue.org>
11 years agometadata.py: ignore posix1e if platform.system() includes CYGWIN.
Rob Browning [Sat, 16 Mar 2013 19:00:32 +0000 (14:00 -0500)]
metadata.py: ignore posix1e if platform.system() includes CYGWIN.

Reported-by: Will Rouesnel <w.rouesnel@gmail.com>
Signed-off-by: Rob Browning <rlb@defaultvalue.org>
11 years agotmetadata.py: skip test_apply_to_path_restricted_access() on Cygwin.
Rob Browning [Sat, 16 Mar 2013 18:17:36 +0000 (13:17 -0500)]
tmetadata.py: skip test_apply_to_path_restricted_access() on Cygwin.

Reported-by: Will Rouesnel <w.rouesnel@gmail.com>
Signed-off-by: Rob Browning <rlb@defaultvalue.org>
11 years agometadata.py: always set xattr to None by default.
Rob Browning [Sat, 16 Mar 2013 17:52:40 +0000 (12:52 -0500)]
metadata.py: always set xattr to None by default.

Reported-by: Will Rouesnel <w.rouesnel@gmail.com>
Signed-off-by: Rob Browning <rlb@defaultvalue.org>
11 years agoDon't even test for Linux xattrs if platform.system() doesn't include Linux.
Rob Browning [Sat, 16 Mar 2013 16:00:24 +0000 (11:00 -0500)]
Don't even test for Linux xattrs if platform.system() doesn't include Linux.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
11 years agoTake additional precautions with the Python/C conversions in _helpers.c.
Rob Browning [Mon, 18 Feb 2013 19:37:58 +0000 (13:37 -0600)]
Take additional precautions with the Python/C conversions in _helpers.c.

bitmatch(): Use Py_ssize_t for byte, to match the values it's compared
against.  Make sure the result will fit in the Python destination.

bloom_add(): Use "n" for the len conversion since len is Py_ssize_t.

bloom_contains(): Make sure the Python -> C converted values' ranges
are appropriate before using them.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Mark J Hewitt <mjh@idnet.com>
11 years agoUse the correct C types when converting between C and Python in _helpers.c.
Mark J Hewitt [Mon, 1 Oct 2012 16:17:28 +0000 (17:17 +0100)]
Use the correct C types when converting between C and Python in _helpers.c.

Previously, bup might fail when handling large repositories.  For
example:

    Traceback (most recent call last):
     File "/usr/lib/bup/cmd/bup-midx", line 258, in <module>
       do_midx_dir(path)
     File "/usr/lib/bup/cmd/bup-midx", line 199, in do_midx_dir
       all = list(do_midx_group(path, part1)) + part2
     File "/usr/lib/bup/cmd/bup-midx", line 216, in do_midx_group
       rv = _do_midx(path, None, sublist, gprefix)
     File "/usr/lib/bup/cmd/bup-midx", line 123, in _do_midx
       count = merge_into(fmap, bits, total, inp)
  OverflowError: size does not fit in an int
  ['/usr/bin/bup', 'midx', '--auto', '--dir',
  '/backup/bup/repository/objects/pack']: returned 1

Signed-off-by: Mark J Hewitt <m.hewitt@computer.org>
[rlb@defaultvalue.org: Remove vestigal header includes.
 Remove Py_ssize_t definition for Python < 2.5.]
Signed-off-by: Rob Browning <rlb@defaultvalue.org>
11 years agoAdd a test to check that bup save without an index fails.
Rob Browning [Mon, 11 Mar 2013 23:32:55 +0000 (18:32 -0500)]
Add a test to check that bup save without an index fails.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
11 years agosave-cmd.py: insist on having an index; check for the primary index file.
Jean-Baptiste Denis [Fri, 8 Mar 2013 22:43:26 +0000 (23:43 +0100)]
save-cmd.py: insist on having an index; check for the primary index file.

Insist on having an index, and report an error (with a suggestion to
run "bup index") if one isn't found.

Previously (at least as recently as 0.25-rc1), bup save would just
create an empty tree if there was no index.  The metadata work
unintentionally broke that behavior.

For now, treat a missing index as an error under the assumption that
it's not likely to be intentional.  If a good use case for the
previous behavior is presented, we can always restore it.

Signed-off-by: Jean-Baptiste Denis <jbd@jbdenis.net>
[rlb@defaultvalue.org: adjust commit message and save-cmd.py error message.]
Signed-off-by: Rob Browning <rlb@defaultvalue.org>
11 years agoNormalize stat(2) timespecs in _helpers.c.
Rob Browning [Sun, 17 Feb 2013 16:33:08 +0000 (10:33 -0600)]
Normalize stat(2) timespecs in _helpers.c.

Previously, the code required timespecs to have a nanosecond value
between 0 and 999999999, because that's what Linux appeared to
produce, but other platforms don't (i.e. Cygwin) -- so normalize the
system values to match expectations.

In particular, look for negative nanosecond values (must be greater
than -10**9), and if found, rewrite the timespec with non-negative
nanoseconds (still less than 10**9).

Thanks to Will Rouesnel <w.rouesnel@gmail.com> for reporting the
problem and posting an initial patch.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
11 years agofind_dir_item_metadata_by_name(): wait for the right item name.
Rob Browning [Sun, 10 Mar 2013 16:25:47 +0000 (11:25 -0500)]
find_dir_item_metadata_by_name(): wait for the right item name.

Fix a bug in the previous patch:

  Include metadata when asked to restore individual non-directory paths.
  53649c18ec3db90f80ff4657315009538d4333f3

Don't return whatever metadata you have the first time you hit a
directory in the dir.  Wait until you find the right name.

Reported-by: varacanero <varacanero@zeromail.org>
Signed-off-by: Rob Browning <rlb@defaultvalue.org>
11 years agoInclude metadata when asked to restore individual non-directory paths.
Rob Browning [Sat, 16 Feb 2013 21:12:47 +0000 (15:12 -0600)]
Include metadata when asked to restore individual non-directory paths.

Adjust bup restore to handle cases like this:

  bup restore -C tmp backup/latest/somewhere/not-a-directory

Previously bup wouldn't restore the metadata for not-a-directory; now
it should.

Add wvtest-bup.sh which includes wvmktempdir().  This function creates
all temporary directories under t/tmp, making cleanup easier.

Add t/test-restore-single-file.sh

Reported-by: Tim Riemenschneider <t.riemenschneider@detco.de>
Signed-off-by: Rob Browning <rlb@defaultvalue.org>
11 years agoMove force-delete to t/lib.sh from test.sh and test-meta.sh; improve.
Rob Browning [Fri, 8 Mar 2013 01:55:18 +0000 (19:55 -0600)]
Move force-delete to t/lib.sh from test.sh and test-meta.sh; improve.

Only call chattr and setfacl on Linux for now.

Test that each item is actually gone.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
11 years agot/test.sh: remove a few calls to force-delete that shouldn't be needed.
Rob Browning [Fri, 8 Mar 2013 01:07:02 +0000 (19:07 -0600)]
t/test.sh: remove a few calls to force-delete that shouldn't be needed.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
11 years agoAdd a force-delete function to t/test.sh
Ryan Brown [Thu, 7 Mar 2013 02:48:23 +0000 (21:48 -0500)]
Add a force-delete function to t/test.sh

Replace "rm -rf" with force-delete because "rm -rf" will proceed even
if it doesn't succeed.  This masked a problem (reported on Fedora)
where the root directory and other system directories had "r-xr-xr-x"
(0555) permissions, causing bup restore to create directories that "rm
-rf" couldn't remove.  As a result, subsequent tests would fail.

Signed-off-by: Ryan Brown <ryansb@csh.rit.edu>
[rlb@defaultvalue.org: edited commit message.]
Reviewed-by: Rob Browning <rlb@defaultvalue.org>
11 years agoFix use of Python assert() with respect to optimization.
Rob Browning [Sun, 3 Mar 2013 22:51:14 +0000 (16:51 -0600)]
Fix use of Python assert() with respect to optimization.

Fix a number of places where bup's assertions had material
side-effects, or where other code expected to see the AssertionError,
neither of which happen when optimization is enabled.

Reported-by: Jon Dowland <jmtd@debian.org>
Signed-off-by: Rob Browning <rlb@defaultvalue.org>
11 years agoMove parse_excludes to helpers and rework it a bit.
Rob Browning [Fri, 8 Mar 2013 00:07:30 +0000 (18:07 -0600)]
Move parse_excludes to helpers and rework it a bit.

Don't use f before it's initialized.

Narrow the catch to open(), and only catch IOException.

Call Options.fatal() when there's an error (as does
helpers.parse_date_or_fatal()).

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
11 years agoUpdate bup-restore.md to match reality; document "/." handling.
Rob Browning [Sun, 3 Mar 2013 19:48:21 +0000 (13:48 -0600)]
Update bup-restore.md to match reality; document "/." handling.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
11 years agobup-save.md: fix --graft documentation bug; use "chroot" consistently.
Rob Browning [Sun, 3 Mar 2013 17:48:27 +0000 (11:48 -0600)]
bup-save.md: fix --graft documentation bug; use "chroot" consistently.

Change mixture of "chroot" and "chroots" in examples to "chroot".

Thanks to "jon.seymour" <jon.seymour@gmail.com> for the report.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
11 years agowvtestrun: invoke perl via /usr/bin/env for portability.
Rob Browning [Sun, 3 Mar 2013 01:59:40 +0000 (19:59 -0600)]
wvtestrun: invoke perl via /usr/bin/env for portability.

This also matches format-subst.pl.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
11 years agoMention what's "in-scope" for 0.25 in HACKING.
Rob Browning [Sat, 2 Mar 2013 18:59:34 +0000 (12:59 -0600)]
Mention what's "in-scope" for 0.25 in HACKING.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
11 years agoOfficially drop support for Python 2.4.
Rob Browning [Mon, 18 Feb 2013 20:42:34 +0000 (14:42 -0600)]
Officially drop support for Python 2.4.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Alexander Barton <alex@barton.de>
11 years agoUpdate HACKING to reflect the glorious death of tmp/pending/meta.
Rob Browning [Tue, 19 Feb 2013 00:47:47 +0000 (18:47 -0600)]
Update HACKING to reflect the glorious death of tmp/pending/meta.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
11 years agoAttempt to fix HACKING link in README.md.
Rob Browning [Tue, 19 Feb 2013 00:43:24 +0000 (18:43 -0600)]
Attempt to fix HACKING link in README.md.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
11 years agoAdd 'x' to the getopts call in t/compare-trees (i.e. allow -x).
Anton Eliasson [Fri, 1 Feb 2013 11:56:15 +0000 (12:56 +0100)]
Add 'x' to the getopts call in t/compare-trees (i.e. allow -x).

Signed-off-by: Anton Eliasson <devel@antoneliasson.se>
Reviewed-by: Rob Browning <rlb@defaultvalue.org>
11 years agoclear_index(): remove unused "cleared" variable.
Rob Browning [Sat, 16 Feb 2013 15:31:57 +0000 (09:31 -0600)]
clear_index(): remove unused "cleared" variable.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
11 years agobloom-cmd: don't explicitly create the bloom file (allow bloom.create()).
Patrick Rouleau [Wed, 13 Feb 2013 03:46:13 +0000 (22:46 -0500)]
bloom-cmd: don't explicitly create the bloom file (allow bloom.create()).

Don't explicitly create the bloom file since bloom.create() will
handle it, and will actually use the correct (binary) mode instead of
"w+".

The binary mode has no effect under Linux or Cygwin, but is important
under Windows.

Signed-off-by: Patrick Rouleau <prouleau72@gmail.com>
Reviewed-by: Zoran Zaric <zz@zoranzaric.de>
Reviewed-by: Rob Browning <rlb@defaultvalue.org>
11 years agoAdd "bup index --clear" to clear the index.
Zoran Zaric [Wed, 13 Feb 2013 02:29:52 +0000 (03:29 +0100)]
Add "bup index --clear" to clear the index.

Signed-off-by: Zoran Zaric <zz@zoranzaric.de>
Reviewed-by: Rob Browning <rlb@defaultvalue.org>
11 years agoAdd the filename/fd and invalid value to stat_struc_to_py error messages.
Rob Browning [Sat, 24 Nov 2012 01:55:17 +0000 (19:55 -0600)]
Add the filename/fd and invalid value to stat_struc_to_py error messages.

Thanks to Nathan Bird <ecthellion@gmail.com> for the initial report.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Reviewed-by: Zoran Zaric <zz@zoranzaric.de>
11 years agoStore metadata in the index, in bupindex.meta; only store unique values.
Rob Browning [Tue, 13 Nov 2012 01:02:14 +0000 (19:02 -0600)]
Store metadata in the index, in bupindex.meta; only store unique values.

See DESIGN for more information.

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

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Reviewed-by: Zoran Zaric <zz@zoranzaric.de>
11 years agoDocument accommodations for filesystems with low-resolution timestamps.
Rob Browning [Mon, 11 Feb 2013 04:54:07 +0000 (22:54 -0600)]
Document accommodations for filesystems with low-resolution timestamps.

...and some effects thereof.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Reviewed-by: Zoran Zaric <zz@zoranzaric.de>
11 years agoChange index; include atime; pack time as xstat timespec; use ns in memory.
Rob Browning [Sat, 10 Nov 2012 19:06:33 +0000 (13:06 -0600)]
Change index; include atime; pack time as xstat timespec; use ns in memory.

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

Change the index to include atimes, and write all times to bupindex as
xstat timespecs.  This is in preparation for indexing all metadata.
After moving all of the times to the index, there should be far fewer
unique instances of the remaining metadata in many/most cases.

Change the index and index-related code to handle all time
values as integer nanoseconds since the epoch, excepting the packed
format, which (as mentioned above) is now an xstat timespec.

After these changes the index-related in-memory and on-disk time value
handling should match that of the metadata code (i.e. metadata.py,
.bupm, etc.).

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Reviewed-by: Zoran Zaric <zz@zoranzaric.de>
[rlb@defaultvalue.org: change 10e8 to 10**9 for ns per second.]

11 years agoHandle nonexistent groups in Metadata._apply_common_rec().
Rob Browning [Sat, 29 Sep 2012 16:21:32 +0000 (11:21 -0500)]
Handle nonexistent groups in Metadata._apply_common_rec().

Thanks to Oei, Yung-Chin <yungchin@yungchin.nl> for tracking this
down.

Reported-by: Yung-Chin <yungchin@yungchin.nl>
Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Reviewed-by: Zoran Zaric <zz@zoranzaric.de>
11 years agoCache all password (pwd) and group (grp) database lookups.
Rob Browning [Sun, 23 Sep 2012 23:26:48 +0000 (18:26 -0500)]
Cache all password (pwd) and group (grp) database lookups.

Thanks to Jann Horn <jannhorn@googlemail.com> for determining that
even just caching user names and group names could provide a notable
performance improvement in some cases.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Reviewed-by: Zoran Zaric <zz@zoranzaric.de>
11 years agoOverhaul restore destination handling, and stripping/grafting behavior.
Rob Browning [Sat, 18 Aug 2012 20:26:28 +0000 (15:26 -0500)]
Overhaul restore destination handling, and stripping/grafting behavior.

Change restore to respond to source paths like this (assume outdir
corresponds to "." if there no -C argument or to -C outdir):

  /foo/what/ever - extract ever to outdir/ever
  /foo/what/ever/ - extract ever/* to outdir/*
  /foo/what/ever/. - extract ever/. to outdir/. (i.e. outdir == ever).

Also fix handling of top-level commit symlinks.  Previously bup would
just restore /foo/latest as a dummy symlink like this:

   latest -> ../.commit/SHA

Instead, dereference latest and restore the target instead.

Tighten up stripping/grafting with additional argument checks, and
handle any root collisions by creating a fake root dir (see comments
in save-cmd.py).  Bup still doesn't handle other path collisions yet,
i.e. if both /foo/bar and /bar are remapped to /bar.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Reviewed-by: Zoran Zaric <zz@zoranzaric.de>
11 years agoAvoid partial writes of config/config.h.
Rob Browning [Thu, 10 Jan 2013 02:23:08 +0000 (20:23 -0600)]
Avoid partial writes of config/config.h.

Write to config/config.h.tmp first, then rename it to config/config.h
once it's complete to avoid the possibility of a partially written
file.

Thanks to Paul Schulz <pschulz01@gmail.com> for reporting the problem.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Reviewed-by: Zoran Zaric <zz@zoranzaric.de>
11 years agoDon't pass --tmpdir to mktemp or expect it to have a default template.
Yung-Chin Oei [Tue, 4 Sep 2012 12:27:52 +0000 (13:27 +0100)]
Don't pass --tmpdir to mktemp or expect it to have a default template.

BSD mktemp does not understand --tmpdir, and does not have a default
pattern if none is supplied.

Signed-off-by: Yung-Chin Oei <yungchin@yungchin.nl>
Acked-by: Gabriel Filion <lelutin@gmail.com>
Reviewed-by: Rob Browning <rlb@defaultvalue.org>
11 years agoDon't pass -AX to rsync in t/compare-trees if xattrs aren't supported.
Rob Browning [Tue, 11 Sep 2012 00:36:18 +0000 (19:36 -0500)]
Don't pass -AX to rsync in t/compare-trees if xattrs aren't supported.

The -AX options won't be available if rsync doesn't report the xattr
capability, so test for that before trying to use them.

Thanks to Yung-Chin Oei <yungchin@yungchin.nl> for the suggested
approach and initial report.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Reviewed-by: Zoran Zaric <zz@zoranzaric.de>
11 years agoMove tree comparison to t/compare-trees; compare content by default.
Rob Browning [Sat, 4 Aug 2012 21:58:45 +0000 (16:58 -0500)]
Move tree comparison to t/compare-trees; compare content by default.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Reviewed-by: Zoran Zaric <zz@zoranzaric.de>
11 years agoAdd preliminary hardlink support for review.
Rob Browning [Sat, 5 May 2012 17:45:01 +0000 (12:45 -0500)]
Add preliminary hardlink support for review.

Thanks to Tim Riemenschneider <git@tim-riemenschneider.de> for
pointing out a compatibility problem (with older versions of Python)
in an earlier version of this patch.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Reviewed-by: Zoran Zaric <zz@zoranzaric.de>
11 years agoStop checking for empty stat values from recursive_dirlist().
Rob Browning [Sun, 13 Jan 2013 23:17:16 +0000 (17:17 -0600)]
Stop checking for empty stat values from recursive_dirlist().

Remove the "if pst:" guard in index-cmd.py, since it doesn't appear to
be possible for recursive_dirlist() to return None for the stat value.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Reviewed-by: Zoran Zaric <zz@zoranzaric.de>
11 years agoPrint a more meaningful error message when help can't run man.
Zoran Zaric [Sat, 26 Jan 2013 18:44:34 +0000 (19:44 +0100)]
Print a more meaningful error message when help can't run man.

Signed-off-by: Zoran Zaric <zz@zoranzaric.de>
[rlb@defaultvalue.org: elaborated on the error message a bit]
Signed-off-by: Rob Browning <rlb@defaultvalue.org>
11 years agoExplicitly use "du -k" to set block size in t/test.sh.
Alexander Barton [Sat, 26 Jan 2013 18:48:47 +0000 (19:48 +0100)]
Explicitly use "du -k" to set block size in t/test.sh.

Commit e3514812 (Explicitly select the "du" block size in t/test.sh)
used the parameter "-B 1024" which isn't portable. Now use "du -k"
to explicitly get output in kilobytes.

At least du(1) on Linux (GNU coreutils), Mac OS X, FreeBSD, NetBSD,
and OpenBSD support this option.

Signed-off-by: Alexander Barton <alex@barton.de>
Reviewed-by: Rob Browning <rlb@defaultvalue.org>
11 years agoAdd *.tmp.meta to .gitignore and to "make clean".
Alexander Barton [Wed, 23 Jan 2013 10:09:10 +0000 (11:09 +0100)]
Add *.tmp.meta to .gitignore and to "make clean".

...since tmpindex.tmp.meta is now generated by "make check".

Signed-off-by: Alexander Barton <alex@barton.de>
Reviewed-by: Rob Browning <rlb@defaultvalue.org>
11 years agoUpdate bup repository address in Documentation/bup.md.
Rob Browning [Sat, 26 Jan 2013 03:51:53 +0000 (21:51 -0600)]
Update bup repository address in Documentation/bup.md.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
11 years agoFix path to git repository in ./README.md.
holmboe [Fri, 25 Jan 2013 16:18:43 +0000 (17:18 +0100)]
Fix path to git repository in ./README.md.

The repository at http://github.com/apenwarr/bup says to go here.

Signed-off-by: Henrik Holmboe <henrik@holmboe.se>
Reviewed-by: Gabriel Filion <lelutin@gmail.com>
Reviewed-by: Zoran Zaric <zz@zoranzaric.de>
11 years agoTry again to create a HACKING link in README.md.
Rob Browning [Fri, 25 Jan 2013 05:47:48 +0000 (23:47 -0600)]
Try again to create a HACKING link in README.md.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
11 years agoTry to create a HACKING link in README.md.
Rob Browning [Fri, 25 Jan 2013 05:44:33 +0000 (23:44 -0600)]
Try to create a HACKING link in README.md.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
11 years agoAdd ./HACKING and refer to it from README.md.
Rob Browning [Wed, 23 Jan 2013 02:31:12 +0000 (20:31 -0600)]
Add ./HACKING and refer to it from README.md.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
11 years agoExplicitly select the "du" block size in t/test.sh.
Rob Browning [Wed, 23 Jan 2013 01:19:20 +0000 (19:19 -0600)]
Explicitly select the "du" block size in t/test.sh.

Since du's default output can be affected by several environment
variables (DU_BLOCK_SIZE, BLOCK_SIZE and BLOCKSIZE), be explicit about
what we want via -B 1024.

Thanks to Michael Ekstrand <michael@elehack.net> for the original
report, and help with the fix.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
11 years agoMakefile: clean config/ during clean.
Yung-Chin Oei [Wed, 24 Oct 2012 02:25:43 +0000 (03:25 +0100)]
Makefile: clean config/ during clean.

Signed-off-by: Yung-Chin Oei <yungchin@yungchin.nl>
Reviewed-by: Rob Browning <rlb@defaultvalue.org>
11 years agoRemove dependency on linux/ext2_fs.h
Yung-Chin Oei [Wed, 24 Oct 2012 02:26:35 +0000 (03:26 +0100)]
Remove dependency on linux/ext2_fs.h

Due to a missing header in (some versions of) linux/ext2_fs.h,
configure's AC_CHECK_HEADERS test fails for this header, making it
appear "not found", and causing Linux-attr support to be disabled in bup
for no good reason.

Given that all the flags bup needs are available in linux/fs.h, we can
safely remove the requirement for linux/ext2_fs.h altogether, to work
around the problem.

Signed-off-by: Yung-Chin Oei <yungchin@yungchin.nl>
Reviewed-by: Rob Browning <rlb@defaultvalue.org>
11 years agoNote linux-libc-dev build dependency (for ext2_fs.h).
Rob Browning [Tue, 22 Jan 2013 01:32:55 +0000 (19:32 -0600)]
Note linux-libc-dev build dependency (for ext2_fs.h).

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
11 years agoExplain current installation process in README.md (i.e. "make install").
Rob Browning [Sun, 13 Jan 2013 05:38:02 +0000 (23:38 -0600)]
Explain current installation process in README.md (i.e. "make install").

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
11 years agoCheck the arguments passed to ./configure.
Rob Browning [Sat, 12 Jan 2013 16:23:04 +0000 (10:23 -0600)]
Check the arguments passed to ./configure.

For now, don't allow arguments, since ./configure doesn't actually
support any.  Previously "./configure --help" would print misleading
information, and any other arguments were silently ignored.

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

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Reviewed-by: Zoran Zaric <zz@zoranzaric.de>
11 years agoProperly escape \r in bup-newliner.md.
Rob Browning [Tue, 1 Jan 2013 17:20:29 +0000 (11:20 -0600)]
Properly escape \r in bup-newliner.md.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
11 years agoNote additional repositories that may be needed for CentOS builds.
Rob Browning [Sat, 12 Jan 2013 19:59:01 +0000 (13:59 -0600)]
Note additional repositories that may be needed for CentOS builds.

Thanks to Paul Schulz <pschulz01@gmail.com> for the report.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
11 years agoAdd missing "install" argument to yum command in README.md.
Rob Browning [Thu, 10 Jan 2013 03:08:52 +0000 (21:08 -0600)]
Add missing "install" argument to yum command in README.md.

Thanks to Paul Schulz <pschulz01@gmail.com> for pointing it out.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
11 years agoAdd instructions for CentOS 6 to README.md.
Rob Browning [Thu, 10 Jan 2013 02:21:47 +0000 (20:21 -0600)]
Add instructions for CentOS 6 to README.md.

Thanks to Paul Schulz <pschulz01@gmail.com> for the information.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
11 years agoDon't assume that the tester's $top_dir will sort (via ls -a) before tmp/.
Rob Browning [Sun, 6 Jan 2013 20:43:11 +0000 (14:43 -0600)]
Don't assume that the tester's $top_dir will sort (via ls -a) before tmp/.

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

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Alexander Barton <alex@barton.de>
11 years agoCheck for a Node's parent before trying to print its name in __repr__.
Martin Zimmermann [Sat, 29 Dec 2012 20:58:10 +0000 (21:58 +0100)]
Check for a Node's parent before trying to print its name in __repr__.

Signed-off-by: Martin Zimmermann <info@posativ.org>
Reviewed-by: Zoran Zaric <zz@zoranzaric.de>
[rlb@defaultvalue.org: Edit commit message.]

11 years agoAdd a metadata() method to Node, File, Symlink, and Dir VFS objects.
Rob Browning [Sat, 21 Jul 2012 20:26:17 +0000 (15:26 -0500)]
Add a metadata() method to Node, File, Symlink, and Dir VFS objects.

The current implementation just populates the self._metadata field of
all of the objects in a directory (and of directory itself) from the
relevant .bupm file whenever metadata() is called on any one of those
objects.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Reviewed-by: Zoran Zaric <zz@zoranzaric.de>
Reviewed-by: Gabriel Filion <lelutin@gmail.com>
11 years agoDefer errors when the restore target doesn't support relevant metadata.
Rob Browning [Sun, 3 Jun 2012 21:49:39 +0000 (16:49 -0500)]
Defer errors when the restore target doesn't support relevant metadata.

When the restore target doesn't support POSIX1e ACLs, extended
attributes, or Linux attributes, handle the failures via add_error()
(i.e. defer them).

Test these cases by creating a loopback VFAT filesystem
(testfs-limited) and using it as a restore target.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Reviewed-by: Zoran Zaric <zz@zoranzaric.de>
11 years agoDisallow empty graft points.
Rob Browning [Sun, 12 Aug 2012 23:18:26 +0000 (18:18 -0500)]
Disallow empty graft points.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Reviewed-by: Zoran Zaric <zz@zoranzaric.de>
11 years agoUpdate README regarding metadata support.
Rob Browning [Sat, 28 Jul 2012 16:42:23 +0000 (11:42 -0500)]
Update README regarding metadata support.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Reviewed-by: Zoran Zaric <zz@zoranzaric.de>
11 years agoHandle the possibility of a sgid/suid parent dir in one of the meta tests.
Rob Browning [Fri, 27 Jul 2012 17:04:35 +0000 (12:04 -0500)]
Handle the possibility of a sgid/suid parent dir in one of the meta tests.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Reviewed-by: Zoran Zaric <zz@zoranzaric.de>
11 years agoQuote EXIT cleanup trap properly in test-meta.sh.
Rob Browning [Wed, 18 Jul 2012 02:26:23 +0000 (21:26 -0500)]
Quote EXIT cleanup trap properly in test-meta.sh.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Reviewed-by: Zoran Zaric <zz@zoranzaric.de>
11 years agoUse python, not groups to grab a user group in t/test-meta.sh.
Rob Browning [Tue, 11 Sep 2012 01:53:45 +0000 (20:53 -0500)]
Use python, not groups to grab a user group in t/test-meta.sh.

Group names may actually contain spaces, and since the groups commmand
only reports a space-delimited list of groups on stdout, we had
a problem.

Thanks to "Oei, Yung-Chin" <yungchin@yungchin.nl> and Gabriel Filion
<lelutin@gmail.com> for tracking this down.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Reviewed-by: Zoran Zaric <zz@zoranzaric.de>
11 years agot/test.sh: fix test failure when $top_dir has a dot-name
Oei, Yung-Chin [Mon, 3 Sep 2012 16:50:30 +0000 (17:50 +0100)]
t/test.sh: fix test failure when $top_dir has a dot-name

Fix the admittedly rare case where we're running tests from a tree
that has a dot-name at its base, which only 'bup ls -a' will print.
This problem was originally encountered on a system that keeps mounts
under '/.autofs/'.

Signed-off-by: Yung-Chin Oei <yungchin@yungchin.nl>
Signed-off-by: Rob Browning <rlb@defaultvalue.org>
11 years agoRestore any metadata during "bup restore"; add "bup meta --edit".
Rob Browning [Sun, 27 Nov 2011 20:39:47 +0000 (14:39 -0600)]
Restore any metadata during "bup restore"; add "bup meta --edit".

Use "bup meta --edit" to test "bup restore" and the new tar/rsync-like
restoration behaviors.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Reviewed-by: Zoran Zaric <zz@zoranzaric.de>
Tested-by: Alexander Barton <alex@barton.de>
11 years agoSave metadata during "bup save".
Rob Browning [Sat, 1 Oct 2011 17:24:36 +0000 (12:24 -0500)]
Save metadata during "bup save".

Record metadata in a hidden/mangled file named .bupm in each
directory, so that the metadata for /foo/ is stored in /foo/.bupm,
with the first entry being the metadata for foo/ itself.

Record an empty index file for each special file so that index entries
and .bupm entries correspond correctly.

Rework the strip/graft functions to return both the save-name, and the
underlying filesystem path to the save-name (when there is one) for
each component.  There may not be corresponding filesystem paths if
graft options rewrite the path prefix.

For now, record "/" metadata only when there are no strip/graft
options.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Reviewed-by: Zoran Zaric <zz@zoranzaric.de>
Tested-by: Alexander Barton <alex@barton.de>
11 years agoUnmount and remove testfs instances correctly during make clean.
Rob Browning [Sun, 3 Jun 2012 17:18:18 +0000 (12:18 -0500)]
Unmount and remove testfs instances correctly during make clean.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Reviewed-by: Zoran Zaric <zz@zoranzaric.de>
11 years agoSince 'latest' is computed by revs[0], it must exist, so don't test it.
Rob Browning [Fri, 23 Nov 2012 20:32:39 +0000 (14:32 -0600)]
Since 'latest' is computed by revs[0], it must exist, so don't test it.

Remove the unnecessary "if latest:" conditional from
BranchList._mksubs().  Given the fact that latest used to be computed
via max(revs), and is now computed by revs[0], there's no way it
wouldn't exist.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
11 years agoUse branch tip, not newest date to choose 'latest' in BranchList._mksubs().
Rob Browning [Fri, 23 Nov 2012 20:18:52 +0000 (14:18 -0600)]
Use branch tip, not newest date to choose 'latest' in BranchList._mksubs().

Previously 'latest' was chosen in the VFS by taking max(revs), which
would pick the most recent commit by rev_list date, which only has a
resolution of integer seconds.

That approach could fail if two commits (i.e. two "bup save" runs)
executed close enough together that both commits ended up with the
same rev_list date.  In that case, the sort order was determined by
the commit hash, which is effectively random.

Since I couldn't think of a case where you wouldn't want 'latest' to
refer to the most recent commit (save) to the relevant branch,
'latest' is now computed as revs[0], i.e. the first commit returned by
rev_list.

Thanks to Zoran and Gabriel for some helpful sanity checks while
tracking this down.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
11 years agoAdd _open_noatime() and use it bup_get_linux_file_attr().
Rob Browning [Sat, 20 Oct 2012 17:55:27 +0000 (12:55 -0500)]
Add _open_noatime() and use it bup_get_linux_file_attr().

Reported-by: Yung-Chin Oei <yungchin@yungchin.nl>
Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Reviewed-by: Yung-Chin Oei <yungchin@yungchin.nl>
11 years agoDepend on the kernel headers, not the ext2 headers, for Linux attr support.
Rob Browning [Sat, 20 Oct 2012 17:35:39 +0000 (12:35 -0500)]
Depend on the kernel headers, not the ext2 headers, for Linux attr support.

Switch to the kernel FS_* defines (in linux/ext2_fs.h) instead of the
EXT* defines (in ext2fs/ext2_fs.h -- from the ext2fs headers).

Also add FS_NOCOW_FL to the "modifiable flags" mask whenever it's
available.

Reported-by: Yung-Chin Oei <yungchin@yungchin.nl>
Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Reviewed-by: Yung-Chin Oei <yungchin@yungchin.nl>
11 years agoAlways run metadata tests; disable root-level tests when not on Linux.
Rob Browning [Sun, 3 Jun 2012 20:18:01 +0000 (15:18 -0500)]
Always run metadata tests; disable root-level tests when not on Linux.

Disable the root-level test-meta.sh tests when the uname output
doesn't match Linux since they're not likely to work elsewhere right
now.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Reviewed-by: Zoran Zaric <zz@zoranzaric.de>
11 years agoConvert BUP_DIR to an absolute path so chdir() won't cause trouble.
Rob Browning [Sat, 18 Aug 2012 19:56:05 +0000 (14:56 -0500)]
Convert BUP_DIR to an absolute path so chdir() won't cause trouble.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Reviewed-by: Zoran Zaric <zz@zoranzaric.de>
11 years agoDefault to stdin/stdout in bup meta when -f is not specified.
Rob Browning [Mon, 26 Dec 2011 19:51:45 +0000 (13:51 -0600)]
Default to stdin/stdout in bup meta when -f is not specified.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Reviewed-by: Zoran Zaric <zz@zoranzaric.de>
11 years agoChange metadata "owner" to "user" everywhere to match stat(2), tar, etc.
Rob Browning [Sat, 24 Dec 2011 16:48:37 +0000 (10:48 -0600)]
Change metadata "owner" to "user" everywhere to match stat(2), tar, etc.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Reviewed-by: Zoran Zaric <zz@zoranzaric.de>
11 years agoFix metadata._set_up_path() to allow restoration of top-level files.
Rob Browning [Sat, 31 Dec 2011 02:40:27 +0000 (20:40 -0600)]
Fix metadata._set_up_path() to allow restoration of top-level files.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Reviewed-by: Zoran Zaric <zz@zoranzaric.de>
11 years agoDon't attempt to remove the Linux attr extents flag (see chattr(1)).
Rob Browning [Sat, 10 Dec 2011 19:24:58 +0000 (13:24 -0600)]
Don't attempt to remove the Linux attr extents flag (see chattr(1)).

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Reviewed-by: Zoran Zaric <zz@zoranzaric.de>
11 years agoMake "bup meta -tv" output look somewhat like "ls -l" output.
Rob Browning [Sun, 7 Aug 2011 17:04:49 +0000 (18:04 +0100)]
Make "bup meta -tv" output look somewhat like "ls -l" output.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Reviewed-by: Zoran Zaric <zz@zoranzaric.de>
11 years agoMake "bup meta -tvv" output identical to "bup xstat".
Rob Browning [Sun, 7 Aug 2011 17:01:08 +0000 (18:01 +0100)]
Make "bup meta -tvv" output identical to "bup xstat".

Move the bits of xstat-cmd.py that generate the detailed metadata
representation to metadata.py and xstat.py to support their use from
both "bup xstat" and "bup meta -tvv".

Add size to detailed metadata description when available.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Reviewed-by: Zoran Zaric <zz@zoranzaric.de>
11 years agoAdd symbolic mode information to xstat output, i.e. (drwxr-xr-x).
Rob Browning [Sun, 7 Aug 2011 16:26:28 +0000 (17:26 +0100)]
Add symbolic mode information to xstat output, i.e. (drwxr-xr-x).

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Reviewed-by: Zoran Zaric <zz@zoranzaric.de>
11 years agoDon't try to restore read-only chattr(1) attributes.
Rob Browning [Sat, 11 Jun 2011 16:39:23 +0000 (11:39 -0500)]
Don't try to restore read-only chattr(1) attributes.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Zoran Zaric <zz@zoranzaric.de>
11 years agoFix typo in _create_via_common_rec() exception message.
Rob Browning [Wed, 29 Jun 2011 03:09:49 +0000 (22:09 -0500)]
Fix typo in _create_via_common_rec() exception message.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Reviewed-by: Zoran Zaric <zz@zoranzaric.de>
11 years agoRecord the file size as Metadata.size when possible.
Rob Browning [Wed, 29 Jun 2011 03:07:10 +0000 (22:07 -0500)]
Record the file size as Metadata.size when possible.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Reviewed-by: Zoran Zaric <zz@zoranzaric.de>
11 years agoFix types and add missing elements to Entry.__repr__() format string.
Rob Browning [Tue, 28 Jun 2011 23:52:29 +0000 (18:52 -0500)]
Fix types and add missing elements to Entry.__repr__() format string.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Reviewed-by: Zoran Zaric <zz@zoranzaric.de>
11 years agoOn ENOTTY or ENOSYS, assume filesystem doesn't support Linux attributes.
Rob Browning [Sun, 12 Jun 2011 16:33:57 +0000 (11:33 -0500)]
On ENOTTY or ENOSYS, assume filesystem doesn't support Linux attributes.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Reviewed-by: Zoran Zaric <zz@zoranzaric.de>
11 years agoRectify bup-split documentation for the fanout option.
Gabriel Filion [Tue, 9 Oct 2012 03:52:35 +0000 (23:52 -0400)]
Rectify bup-split documentation for the fanout option.

The --fanout option is no longer the maximum number of objects in a
tree, but an average. The documentation, however was never updated and
this can lead to misunderstandings.

Also add a "bold" delimiter that was forgotten in the command summary in
its documentation page.

Signed-off-by: Gabriel Filion <lelutin@gmail.com>
Reviewed-by: Rob Browning <rlb@defaultvalue.org>
11 years agoDocumentation: Protect file extensions from start of line.
Gabriel Filion [Mon, 1 Oct 2012 07:13:53 +0000 (03:13 -0400)]
Documentation: Protect file extensions from start of line.

In the documentation files, we use file extensions as words to simplify
the text. When compiling man pages from the Markdown files, it is
possible that an extension lands at the beginning of a line.

In such a case, the extension is mistakenly identified as a Groff macro.
It seems as though Groff simply ignores it since it is not a known
macro, but emits a warning about the syntax.

This was caught thanks to the debian package's lintian output at:

http://lintian.debian.org/maintainer/jmtd@debian.org.html#bup

Since we're putting highlighting on file extensions, we should add it to
all cases, even though there's not risk of it landing at the beginning
of a line. This way, the documentation looks better standardized.

Signed-off-by: Gabriel Filion <lelutin@gmail.com>
Reviewed-by: Rob Browning <rlb@defaultvalue.org>
11 years agoMake import-rdiff-backup's output more verbose
Zoran Zaric [Mon, 24 Sep 2012 22:30:15 +0000 (00:30 +0200)]
Make import-rdiff-backup's output more verbose

Signed-off-by: Zoran Zaric <zz@zoranzaric.de>
Reviewed-by: Gabriel Filion <lelutin@gmail.com>