Tim Kientzle [Sat, 1 May 2010 21:18:38 +0000 (17:18 -0400)]
Add --gid, --gname, --uid, --uname options to tar.
These allow you to override the user/group information both
when creating an archive and when restoring an archive.
I've also reimplemented --numeric-owner to be a synonym
for --gname="" --uname="".
Port NetBSD's rb.c. Changes here are:
- Use archive_ prefix for types and __archive_ prefix for the functions
to avoid conflicts with system headers.
- No debug code, statistics and only the "small" code.
- No stdbool.h.
The only real assumption is that pointers have 4 bytes alignment.
Initial implement of red black tree to speed up making ISO image with
many entries(about over 100K) in a directory.
In my environment this is twice as fast as previous way.
Brian Harring [Mon, 26 Apr 2010 01:44:24 +0000 (21:44 -0400)]
fix archive_filter_count to actually work; implementation of this aparently was never finished, vtable stubs never had any implementation for this functionality, thus an instant segfault on invocatoin
Only include the FreeBSD-style extended attribute support, if
EXTATTR_NAMESPACE_USER is defined. It is missing on FreeBSD 4 and
DragonFly. Reported by Antonio Huete Jimenez as NetBSD's pkg/43175.
Brian Harring [Mon, 19 Apr 2010 05:24:01 +0000 (01:24 -0400)]
this could stand review, but should be right; setting ret to ARCHIVE_FAILED here is a pointless no op so archive_format_gnutar_header assignment shortly after wipes the ret... potentially this should be set to a warn and then combined w/ the other returns
Tim Kientzle [Sun, 18 Apr 2010 05:56:53 +0000 (01:56 -0400)]
Basic implementation of a GNU tar-compatible writer. This uses
the header conventions used by GNU tar 1.13 and later. In particular:
* name and linkname are permitted to fill their respective fields
(Earlier GNU tar guaranteed a trailing null)
* mode field does not include the file type
(Earlier GNU tar included file type bits in the mode field)
* Most fields are filled with leading '0' characters
(Earlier GNU tar used leading spaces)
Tim Kientzle [Sun, 11 Apr 2010 21:29:32 +0000 (17:29 -0400)]
Fix tar --keep-newer
This solution isn't ideal; bsdtar does the right thing now
(doesn't overwrite and exits without error) but it should
display a warning message about the failure to extract
the file.
Tim Kientzle [Sun, 11 Apr 2010 19:11:36 +0000 (15:11 -0400)]
Issue 83: Directory timestamps truncated to microsecond resolution.
This patch reworks the time-restore logic to use the same
system calls in both the end-of-archive cleanup pass and
the regular file restore case. This ensures consistent
timestamp restores for both cases. It also isolates the
BSD birthtime support into one place so it will be consistently
applied.
Tim Kientzle [Sun, 11 Apr 2010 18:08:36 +0000 (14:08 -0400)]
Improve the testing of tar -X and try to correctly handle some odd cases.
Here are some of the cases currently handled
(assuming test.tar contains a single entry "file1"):
$ tar xf test.tar file1
Extracts file1 with no error.
$ tar xf test.tar file1 file2
Extracts file1, error because file2 was requested but not found.
$ tar xf test.tar file1 'file2*'
Extracts file1, error because 'file2*' pattern matched no entries.
Tim Kientzle [Sun, 11 Apr 2010 00:10:58 +0000 (20:10 -0400)]
Adjust this test slightly so it doesn't depend on a
particular order of traversing the directory.
In particular, this test almost passes against
GNU tar 1.23. The difference being that GNU tar
considers it an error when a hardlink cannot
be extracted because the target was erased by
--strip-components and bsdtar does not consider
this an error. Both extract the same files;
the only difference is that GNU tar emits
some error messages and exits with an error
status, while bsdtar exits with success.
Tim Kientzle [Sat, 10 Apr 2010 21:27:38 +0000 (17:27 -0400)]
Test -C
* Add a "testworkdir" global for tests that need an absolute path to their work directory
* Exercise -C failure and corner cases such as -C nonexistent -C /absolute
Tim Kientzle [Sat, 10 Apr 2010 21:02:55 +0000 (17:02 -0400)]
Test cleanup:
* Use assertMakeFile() instead of fopen/fwrite/fclose
* Remove -s tests from test_option_T_upper; they just duplicate tests in test_option_s
Brian Harring [Sun, 4 Apr 2010 05:43:17 +0000 (01:43 -0400)]
fwrite is marked w/ check return, thus doing make check results in build failures due to -Werror forced in trunk. assert the fwrite return to fix the issue, and more importantly the extremely unlikely scenario where the write doesn't manage to flush the desired size (if this isn't caught, it'll result in weird failures further in the tests)