Show better errors with out-of-range Entry values

When values can't be encoded in a struct, it's useful to actually give the values.

Signed-off-by: Tim Hatch <tim@timhatch.com>
Fix a bug where marginally old files couldn't be stored in the index

Due to the struct having unsigned timestamps, files with dates between Dec 13,
1901 and Jan 1, 1970 were not representable.  This change extends the struct to
be able to pack signed timestamps, which was the spirit of code in _fixup, and
extends the useful range back to 1901. Timestamps prior to 1901 are still
adjusted to zero, as they were before.

There should be no compatibility problems loading packed structures created
before this change, since positive values were truncated at 0x7fffffff.

Signed-off-by: Tim Hatch <tim@timhatch.com>
Missing space in optspec

Signed-off-by: Tim Hatch <tim@timhatch.com>
Fix compile error using GCC 4.6.
DESIGN: mention bloom filters.

Jeff Anderson-Lee discovered the missing information and posted to the
mailing list.  Gabriel Filion reminded me to actually update the docs :)

Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
Doc: add some precisions for --remote and dumb mode

The -r/--remote argument to some of bup's commands currently doesn't
give enough information about how to customize options to SSH. Let's add
information about this so that users know how to customize options for
SSH connections.

Also, in bup-server's documentation, point out which mode is the default
one for more clarity.

Signed-off-by: Gabriel Filion <lelutin@gmail.com>
Merge branch 'master' of git://github.com/thatch/bup

* 'master' of git://github.com/thatch/bup:
  Missing space in optspec
  Fix a bug where marginally old files couldn't be stored in the index
  Show better errors with out-of-range Entry values
xstst-cmd.py: test for _have_utimensat rather than _have_ns_fs_timestamps.

Test for _have_utimensat rather than _have_ns_fs_timestamps to decide
whether or not to print the atime and mtime, since the existence of
utimensat() is the real indicator, and since _have_ns_fs_timestamps is
going away.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Drop xstat floating point timestamp support -- use integer ns.

Drop conditional support for floating point timestamps (the xstat
os.stat() fallback).  Switch to integer nanosecond timestamps
everywhere except the metadata record encoding and _helpers.c.

The metadata encoding is still a timespec because separate s and ns
timespec vints compress much better, and timespecs are still returned
by _helpers because the conversion to integer nanoseconds is much more
convenient in Python.

Enforce timespec range expectations -- throw an exception if the
system returns a nanosecond value less than 0 or greater than
999999999.  Remove _have_ns_fs_timestamps.

Depend on bup_stat(), bup_stat(), and bup_lstat() unconditionally, and
change the timespec return conversion from "(ll)" to "(Ll)", i.e. long
long range for secs.

This commit may break the build on some platforms -- we'll have to add
suitable conditionals once we see what's needed.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Replace os.*stat() with xstat.*stat(); use integer ns for all fs times.

Replace all calls of the os.*stat() functions with calls to the xstat
equivalents.  This should leave bup with the xstat stat representation
(and integer ns timestamps) everywhere.

Remove FSTime, and add a few xstat conversion functions to replace the
bits we still want: timespec_to_nsecs(), nsecs_to_timespec(),
fstime_floor_secs(), fstime_to_timespec().

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Return None from bup_set_linux_file_attr() and bup_utimensat().

Return None from bup_set_linux_file_attr() and bup_utimensat() since
errors are handled by exceptions.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Add initial timespec behavior tests.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Remove vestigal clean target comment regarding pybuptest.tmp permissions.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Rely on options.parse() for more of the meta and xstat argument processing.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Prefix paths in grafting- and stripping-tests

On systems with symlinks in the used paths the tests failed.  This adds
a prefix to the used paths, that is not likely to exist.

Signed-off-by: Zoran Zaric <zz@zoranzaric.de>
Earlier "negative timestamp" patch had a 64-bit timestamp in the test.

The date in the comment is correct - for -0x80000000.  Sadly, the *code*
actually said -0x90000000.  That works on 64-bit systems (and filesystems)
not not 32-bit ones, where python gives an encoding error.

In any case, based on the comment (June 10, 1893) it seems tat -0x80000000
must have been the intended value anyway.  Now 'make test' passes on 32-bit
Linux again.

Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
Remove a file created in a index test

Signed-off-by: Zoran Zaric <zz@zoranzaric.de>
fixed cp problem in bup/t/test-meta.sh
Initial import of configure.sh

Imported configure 0.59

http://www.pell.portland.or.us/~orc/Code/configure/

Also added a bunch of simple tests, check for utimensat
and added ifdef to relavent code path.
Makefile: add a PREFIX variable for locations other than /usr.

make install PREFIX=/usr/local

Signed-off-by: Michael Barabanov <michael.barabanov@gmail.com>