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>
Add symbolic mode information to xstat output, i.e. (drwxr-xr-x).

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
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>
Make "bup meta -tv" output look somewhat like "ls -l" output.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Don't attempt to remove the Linux attr extents flag (see chattr(1)).

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Fix metadata._set_up_path() to allow restoration of top-level files.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Change metadata "owner" to "user" everywhere to match stat(2), tar, etc.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Save metadata during "bup save".

Record metadata in a hidden/mangled file named .bup in each directory,
so that the metadata for /foo/ is stored in /foo/.bup, with the first
entry being the metadata for foo itself.  Record an empty index file
for each special file so that the index entries and .bupm entries
correspond.

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

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Default to stdin/stdout in bup meta when -f is not specified.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
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>
Add preliminary hardlink support for review.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Unmount testfs properly during "make clean".

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Re-enable metadata tests by default since this is the metadata dev branch.

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>
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>
Quote EXIT cleanup trap properly in test-meta.sh.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Handle the possibility of a sgid/suid parent dir in one of the meta tests.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Update README regarding metadata support.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
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>
Move tree comparison to t/compare-trees; compare content by default.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Add support for "bup index --exclude-rx <pattern> ...".

When --exclude-rx <pattern> is provided to bup index, exclude any path
matching <pattern>, which must be a Python regular expression
(http://docs.python.org/library/re.html).  The pattern will be
compared against the full path, without anchoring, so "x/y" will match
"ox/yard" or "box/yards".  To exclude the contents of /tmp, but not
the directory itself, use "^/tmp/.".

You may check the behavior at runtime by setting BUP_DEBUG=2 in the
environment.

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