Charles Wilson [Fri, 20 Mar 2009 06:10:07 +0000 (02:10 -0400)]
Issue 15, part 10. __FBSDID macro
Is defined on the non-FreeBSD cygwin platform.
This is because its libc is based on newlib, which borrows
a lot of FreeBSD code unchanged. So, can't unconditionally
define this macro but must guard it.
Charles Wilson [Fri, 20 Mar 2009 06:01:23 +0000 (02:01 -0400)]
Issue 15, part 9. WINVER macro
When compiling with the w32api headers (used by mingw and cygwin)
some symbols are not brought into scope by _WIN32_WINNT alone, but
also require WINVER. Also, in *_cygwin.c files, change 0x500 to
0x0500, for consistency with *_windows.c ones.
Charles Wilson [Fri, 20 Mar 2009 05:47:49 +0000 (01:47 -0400)]
Issue 15, part 8. Headers and #includes...
cpio/test/test.h: remove now-useless #else branch
cpio/cpio.c: ensure <time.h> and <sys/time.h> are included
(fixes compile failure on cygwin)
libarchive/archive_write_disk.c: change order of #includes
(sys/xattr must preceded attr/xattr on linux, or compile fails)
Improve cmake detecting a function on linux.
The GNU C library defines stub functions(chflags, fchflags..),
and so cmake detecting the function process found out that
stub function. This commit avoid detecting the stub function.
Charles Wilson [Thu, 19 Mar 2009 02:54:30 +0000 (22:54 -0400)]
Issue 15, part 6. Fix test failure on cygwin-1.7.x
In cpio/test/tests.h: new #define to disable certain
tests on cygwin. POSIX does not require that the .nlinks
field be accurate for directories, and as an optimization
newer cygwin does not even try to ensure its accuracy.
Therefore, it is not a failure if wrong; cpio tests should
not verify its value -- at least on cygwin.
cpio/test/test_format_newc.c: Use new #define to skip
.nlinks test.
cpio/test/test_option_c.c: ditto.
Charles Wilson [Thu, 19 Mar 2009 02:43:53 +0000 (22:43 -0400)]
Issue 15, part 5. New files for cygwin/cpio
Added cpio/cpio_cygwin.[c|h] which are simply copies
of the relevant portions of cpio/cpio_windows.[c|h]
Modified cpio/cpio_platform.h to #include as needed.
Modified cpio/cpio.c to call new bsdcpio_is_privileged()
function on cygwin also.
Charles Wilson [Thu, 19 Mar 2009 02:36:24 +0000 (22:36 -0400)]
Issue 15, part 4. New files for cygwin/bsdtar
Added tar/bsdtar_cygwin.[c|h] which are simply copies
of the relevant portions of tar/bsdtar_windows.[c|h]
Modified tar/bsdtar_platform.h to #include as needed.
Charles Wilson [Wed, 18 Mar 2009 03:43:12 +0000 (23:43 -0400)]
Issue 15, part 1. Mechanical conversion of #defines, libarchive/
#ifdef _WIN32 --> #if defined(_WIN32) && !defined(__CYGWIN__)
#ifndef _WIN32 --> #if !defined(_WIN32) || defined(__CYGWIN__)
Exceptions to the general rule:
libarchive/archive.h: we want declspec for both
libarchive/archive_entry.h: ditto
libarchive/archive_write_disk.c: we want to fix backslashs,
and to use cleanup_pathname_win on both.
Tim Kientzle [Tue, 17 Mar 2009 22:51:42 +0000 (18:51 -0400)]
Our installation instructions assume you already have a tar
program. This is a minimalist implementation that should
allow people to bootstrap the full libarchive distribution.
On Windows, skip test_owner_parse. Windows cannot handle uid/gid as
UNIX like system. We need to improve it.
Now all bsdcpio tests passed.
Results are:
0 of 22 tests reported failures
Total of 675 assertions checked.
Total of 0 assertions failed.
Total of 1 assertions skipped.
Check _WIN32 instead of __timeval when we use struct __timeval.
__timeval is defined in archive_windows.h and we use it for
Windows only, so __timeval is not expected for using on other
platform.
Tim Kientzle [Mon, 9 Mar 2009 21:22:32 +0000 (17:22 -0400)]
As suggested by Joerg Sonnenberger, change archive_strncat() to
take a void * source instead of char *. In particular, this should
reduce the number of gratuitous casts in code that uses
"unsigned char *".
Tim Kientzle [Sun, 8 Mar 2009 08:42:26 +0000 (04:42 -0400)]
Since the most popular XZ decompression library also supports LZMA,
just fold the LZMA handling into the XZ reader. This also eliminates
some duplication of bid code. Also, clean up the style a bit to
exploit the peek/consume I/O style.
Tim Kientzle [Tue, 3 Mar 2009 03:55:54 +0000 (22:55 -0500)]
Fix "tomorrow UTC" and similar phrases by not setting the default
time elements until after we've parsed the string. Then we can
use the parsed timezone (if any) to set up the default time elements.
In particular, this makes this code a lot easier to test, since
otherwise local DST keeps intruding.
Tim Kientzle [Thu, 26 Feb 2009 04:35:57 +0000 (23:35 -0500)]
Add a variant of read_open_memory() that does not register open,
skip, or close callbacks. Use this in read_pax_truncated to partially
verify extraction with clients that only register a minimal set
of callbacks (recall that only the read callback function is
mandatory; in fact, the open callback is deprecated and will
likely be removed in libarchive 3.0).