Commit Graph

18 Commits

Author SHA1 Message Date
Tim Kientzle
e2421f7667 Merge from libarchive.googlecode.com: Mostly a bunch of
corrections to the Windows support to reconcile differences
between Visual Studio and Cygwin.  Includes parts of
revisions 757, 774, 787, 815, 817, 819, 820, 844, and 886.

Of particular note, r886 overhauled the UTF-8/Unicode conversions to
work correctly regardless of whether the local system uses 16-bit
or 32-bit wchar_t.  (I assume that systems with 16-bit wchar_t
use UTF-16 and those with 32-bit wchar_t use UCS-4.)  This revision
also added a preference for wcrtomb() (which is thread-safe) on
platforms that support it.
2009-04-12 05:33:34 +00:00
Tim Kientzle
9d875e6973 Merge r718 from libarchive.googlecode.com: Some additional
tests of restoring files to disk with unusual characters, specifically
to exercise Windows issues.
2009-03-07 07:23:04 +00:00
Tim Kientzle
690f818afd Merge r294:337,r348:350 from libarchive.googlecode.com: A lot
of work to make libarchive work on Windows.
2009-03-03 17:02:51 +00:00
Tim Kientzle
f70105fb18 MfP4: restore birth time data to disk + more thorough tests for
time restore to disk.

MFC after:	30 days
2008-09-30 04:02:36 +00:00
Tim Kientzle
a0bfb8ae3e MfP4: Handle entries with unset size properly: Regular files with
unspecified size are "unlimited" (required by Zip reader, which
sometimes does not know the uncompressed size of an entry until it
gets to the end).  Also, hardlinks with unspecified (or zero) size do
not overwrite the data on disk nor do they set metadata.  This is
compatible with GNU tar and NetBSD pax behavior.
2008-09-05 06:13:11 +00:00
Tim Kientzle
0c35edadaa Style: Use ARCHIVE_VERSION_NUMBER to conditionalize tests on
the particular libarchive version being tested instead of the
deprecated ARCHIVE_API_VERSION and ARCHIVE_VERSION_STAMP macros.
2008-09-01 05:38:33 +00:00
Tim Kientzle
e32c65cb17 Use the "start_time" (time at which the restore process began)
to fill in a missing atime instead of substituting mtime.

PR:		bin/124915
2008-09-01 02:50:24 +00:00
Tim Kientzle
cec048ddf0 When atime wasn't specified, it should get set == mtime.
This is much stronger than just asserting that it's not zero.
2008-08-30 05:31:23 +00:00
Tim Kientzle
9cfec77e7e If no atime was specified (for example, when extracting from ustar
archives), set atime == mtime.  Before this, atime would get restored
to 0.
2008-08-28 06:40:22 +00:00
Tim Kientzle
c8390967f2 MfP4: test harness improvements. 2008-06-15 10:35:22 +00:00
Tim Kientzle
991a64e41e Explain a subtle API change that was made recently.
Even though I believe this is a good change, it does
have the potential to break certain clients, so it's
good to document the reasoning behind the change.
2008-01-23 05:47:08 +00:00
Tim Kientzle
22177dd3e6 The previous commit caused the archive_write_disk interface to
start obeying filesize limits; this test wasn't properly setting
file sizes before trying to write file data.
2008-01-18 05:48:50 +00:00
Tim Kientzle
016e328d16 Fix the archive_write_data() function so it always returns
number of bytes written, even when used to write files to
disk.  Extend the test suite to verify the correct return
values for archive_write_data() and archive_write_data_block().

Thanks to: Bruce Mah, for stepping in promptly to back out the
   earlier broken version of this fix
Thanks to: Colin Percival, for pointing out the correct fix
MFC after: 5 days
Approved by: re (ksmith)
Pointy hat: \me
2007-09-21 04:52:43 +00:00
Bruce A. Mah
7b7b893394 Revert the last commit to libarchive. It introduced some regresssions,
most noticably the incorrect extraction of files by bsdtar.

This commit reverts:

	src/lib/libarchive/archive_write_disk.c 1.15
	src/lib/libarchive/test/test_write_disk.c 1.4

Approved by:	re (implicitly)
2007-09-18 20:20:37 +00:00
Tim Kientzle
8f3ba4ccf4 Correct the return value from archive_write_data()
(when used to restore files to disk) to match:
  * The documentation
  * The return values of this function when used
    to write files into an archive.

Approved by: re (bmah)
Pointy hat: \me
MFC after: 5 days
2007-09-18 04:20:21 +00:00
Tim Kientzle
dbb4eb7d9c Make test suite work with libarchive 1.3.1: Take advantage of
ARCHIVE_VERSION_STAMP to selectively disable tests that don't
apply to that version; new "skipping()" function reports skipped
tests; modify final summary to report component test failures and
skips.

Note:  I don't currently intend to MFC the test suite itself;
anyone interested should just checkout and use this version
of the test suite, which should work for any library version.

Approved by: re (Ken Smith, blanket)
2007-07-06 15:43:11 +00:00
Tim Kientzle
b48b40f1f8 libarchive 2.2.3
* "compression_program" support uses an external program
  * Portability: no longer uses "struct stat" as a primary
    data interchange structure internally
  * Part of the above: refactor archive_entry to separate
    out copy_stat() and stat() functions
  * More complete tests for archive_entry
  * Finish archive_entry_clone()
  * Isolate major()/minor()/makedev() in archive_entry; remove
    these from everywhere else.
  * Bug fix: properly handle decompression look-ahead at end-of-data
  * Bug fixes to 'ar' support
  * Fix memory leak in ZIP reader
  * Portability: better timegm() emulation in iso9660 reader
  * New write_disk flags to suppress auto dir creation and not
    overwrite newer files (for future cpio front-end)
  * Simplify trailing-'/' fixup when writing tar and pax
  * Test enhancements:  fix various compiler warnings, improve
    portability, add lots of new tests.
  * Documentation: document new functions, first draft of
    libarchive_internals.3

MFC after: 14 days
Thanks to: Joerg Sonnenberger (compression_program)
Thanks to: Kai Wang (ar)
Thanks to: Colin Percival (many small fixes)
Thanks to: Many others who sent me various patches and problem reports.
2007-05-29 01:00:21 +00:00
Tim Kientzle
f81da3e584 libarchive 2.0
* libarchive_test program exercises many of the core features
  * Refactored old "read_extract" into new "archive_write_disk", which
    uses archive_write methods to put entries onto disk.  In particular,
    you can now use archive_write_disk to create objects on disk
    without having an archive available.
  * Pushed some security checks from bsdtar down into libarchive, where
    they can be better optimized.
  * Rearchitected the logic for creating objects on disk to reduce
    the number of system calls.  Several common cases now use a
    minimum number of system calls.
  * Virtualized some internal interfaces to provide a clearer separation
    of read and write handling and make it simpler to override key
    methods.
  * New "empty" format reader.
  * Corrected return types (this ABI breakage required the "2.0" version bump)
  * Many bug fixes.
2007-03-03 07:37:37 +00:00