Tim Kientzle [Thu, 26 Mar 2009 06:23:14 +0000 (02:23 -0400)]
Rename --format-options to simply --options, since these are options
for filter/compressors as well as format handlers.
On write, set options before we open the file.
Tim Kientzle [Thu, 26 Mar 2009 06:16:47 +0000 (02:16 -0400)]
Succeed if we're handed an empty or NULL option argument.
In particular, this simplifies clients such as bsdtar, which can
now simply call archive_read_set_options() with a fixed string
that may be NULL.
Tim Kientzle [Thu, 26 Mar 2009 06:14:29 +0000 (02:14 -0400)]
Return ARCHIVE_OK for "indent" and "use-set" options, which
are consumed but don't use the 'keybit' mechanism. Without
this, mtree options returned ARCHIVE_WARN ("not used") for
these options.
When generating list.h file, Do not check CMAKE_CURRENT_LIST_FILE
at GENERATE_LIST_H macro. It will have a wrong path
if GENERATE_LIST_H macro is called from other CMakeList.txt.
Tim Kientzle [Tue, 24 Mar 2009 20:01:00 +0000 (16:01 -0400)]
Add archive_read_next_header2(), which populates the archive_entry
object passed into it. Make archive_read_next_header() be the obvious
wrapper that just reuses a single entry object. This has been shown
to provide a big speedup for cases where people want to generate a list
of every entry in an archive; creating a new entry is faster than cloning
an existing entry.
Remove a lot of duplicate functions which simulates POSIX
function for Windows platform. And move the remaining
simulate functions to archive_windows.[ch]. It will be
easy maintenance and avoid the same named functions having
different codes. This change does *not* mean libarchive
library has those ones or exports it. All libarchive's
executable programs include archive_windows.c for one of
its program files.
Tim Kientzle [Sun, 22 Mar 2009 17:17:27 +0000 (13:17 -0400)]
Issue 16: Change the text files to all end in '.txt' for the
convenience of file browsers (including Windows shell, KDE, Mac OS
Finder, etc) that use file extensions as a type hint.
Tim Kientzle [Sun, 22 Mar 2009 05:58:07 +0000 (01:58 -0400)]
Files that are used by the autoconf build system belong in
the build/autoconf dir. We may need to further split that
out to separate the files that get generated by autoconf/automake/etc
from the files that are provided by libarchive.
Charles Wilson [Sat, 21 Mar 2009 14:25:50 +0000 (10:25 -0400)]
Issue 15, part 14. Build system
build/m4/la_syslibsearchpath.m4: New. Allows to automatically
determine where binmode.o is located, even on cross builds (hopefully).
configure.ac: specify AC_CONFIG_MACRO_DIR, AC_CANONICAL_HOST, and
AC_LIBTOOL_WIN32_DLL. Add new AM_CONDITIONALs INC_WINDOWS_FILES and
INC_CYGWIN_FILES. Use new macro LA_SYS_LIB_SEARCH_PATH to set
new AC_SUBST, PROG_LDADD_EXTRA, to <some path>/binmode.o on cygwin.
Makefile.am: Specify ACLOCAL_AMFLAGS. Use INC_WINDOWS_FILES and
INC_CYGWIN_FILES where appropriate. Update all *_EXTRA_DIST variables
with new files. Add -DLIBARCHIVE_STATIC to all *_test_CPPFLAGS. Add
or update existing ${APP}_LDADD to specify @PROG_LDADD_EXTRA@ (this
enables to link apps with binmode.o on cygwin).
Works on cygwin (ac-2.63, am-1.10.1, libtool-2.2.7a). Passes all tests.
Works on linux (ac-2.61, am-1.10, libtool-1.5.22). Passes all tests.
Tim Kientzle [Fri, 20 Mar 2009 19:21:45 +0000 (15:21 -0400)]
Testing: test_pathmatch.c now has 100% test coverage of pathmatch.c
Allow '$' to force anchor at end iff PATHMATCH_NO_ANCHOR_END is in flags.
Fix backslash escaping so that patterns such as "\\/./" or "/\\./" match
an explicit "/./" but do not match plain "/", even though "/./" does
ordinarily match "/".
I think this is finally sufficient to match my long-standing desire
to be able to extract "./foo/" by just asking for "foo".
There's still an open question whether this can be extended to handle
Windows-style \ path separators without causing conflicts with
the use of \ as a quote character. I don't think it can.
Split a CMakeLists.txt into each subdirectory, and remove
useless '#include LIST_H'. It was used for out-of-source build
with the previous CMakeLists.txt.
Charles Wilson [Fri, 20 Mar 2009 07:52:34 +0000 (03:52 -0400)]
Issue 15, part 13. cygwin test failures
cpio/test/test_owner_parse.c: Attempt to work around lack
of 'root' account. May need to revisit.
libarchive/archive_write_disk.c: For cygwin, go ahead and try
to chown if requested; don't assume failure based on uid/gid.
libarchive/test/test_read_disk.c: For cygwin, don't attempt
to verify "standare" uname/gname lookup.
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.