Use CMAKE_PREFIX_PATH directly by the people who use cmake.
On Windows, set "C:/Program Files/GnuWin32" to
CMAKE_PREFIX_PATH instead of "C:/Program Files/GnuWin32/lib".
Add check that path is existed.
Tim Kientzle [Thu, 29 Jan 2009 07:01:48 +0000 (02:01 -0500)]
Always swallow the PK\007\008 end-of-data marker, even if this
is a non-regular file. In particular, it seems that some "jar"
programs store directory entries using length-at-end semantics.
Which is wasteful (a directory is always zero length, so there's
no point in storing the additional data), but entirely legal.
Tim Kientzle [Thu, 22 Jan 2009 05:58:23 +0000 (00:58 -0500)]
Don't append the strerror() information here; we're returning
the errno anyway, so the client can do that if they want.
In particular, this fixes a lot of duplicated errno information.
Tim Kientzle [Mon, 19 Jan 2009 06:33:42 +0000 (01:33 -0500)]
Read extended attributes from disk on FreeBSD.
This should be the last piece needed for functional extended attribute
handling on FreeBSD. More testing is required, though.
Tim Kientzle [Sun, 18 Jan 2009 19:22:22 +0000 (14:22 -0500)]
Rely on the compiler's include search path to find config.h files.
This works much better when building with a variety of build systems;
all of them can edit the include path but not all of them put the
built configure files in the same place.
Tim Kientzle [Sun, 18 Jan 2009 08:10:52 +0000 (03:10 -0500)]
Many improvements to cmake builds on FreeBSD, though there are still some rough edges:
Better:
* "make && make test" works and tests pass
* -Denable_tar=no -Denable_cpio=no -Denable_test=no are all supported
* Some progress towards out-of-source builds:
"mkdir build && cd build && cmake .." now doesn't pollute the dist dir
Still broken:
* out-of-source build attempt doesn't create a Makefile?
* out-of-source build needs to add compile option for locating config.h
* "make clean" doesn't work
* "make install" doesn't work
Tim Kientzle [Thu, 15 Jan 2009 05:17:08 +0000 (00:17 -0500)]
In archive_write_disk: If archive_write_header() fails to create
the file, that's a failure and should return ARCHIVE_FAILED.
Metadata restore failures still return ARCHIVE_WARN, because
that's non-critical. Fix test_write_disk_secure test to
verify the correct return code in one case; add test_write_disk_failures
to do another very simple test of restore failure.
In particular, this fixes the problem found with xattr restores
that a failure in setting an xattr would prevent the file and other
metadata from being written. Now, an xattr restore failure generates
a warning but does not prevent the rest of that file's data and metadata
from being properly written.
Tim Kientzle [Tue, 13 Jan 2009 04:58:16 +0000 (23:58 -0500)]
Merge r187126 from FreeBSD-CURRENT:
"The first part is just to give more info, the latter part fixes
an error to read files past the 32bit byte offset, for instance
on DVDs."
This occurs with Zip archives that have entries that are
compressed with deflate even though they are zero bytes
long. Libarchive's zip handler returns a zero-byte block
from the decompression before returning end-of-entry.
Writing that zero-byte block back to the filesystem
triggered some code intended to catch misuse of the API.
The fix suppresses the warning in the case of a zero-byte
write request.
This is all very silly: compressing a zero-byte file is
a silly thing to do, libarchive's zip format handler is
returning a silly sequence of responses, and the warning
is silly. Oh, well. At least I fixed the warning. ;-)
Tim Kientzle [Thu, 8 Jan 2009 06:52:41 +0000 (01:52 -0500)]
archive_read_disk_entry_from_file() knows how to pull
all metadata about a file from the filesystem to populate
an entry object. This takes advantage of the user/group
name lookup capabilities of the archive_read_disk object.
This should simplify bsdtar and bsdcpio by removing the
comparable code from those utilities.
Replace a path separator to '/' in archive_write_disk.c,
if the path separator of the running system is not '/'.
Because of libarchive expect the path separator
is '/' where program check the one.
On Windows, now archive_read_disk_set_standard_lookup.c is linked.
We call archive_read_disk_set_standard_lookup() function on
libarchive_test again, and check a value which that function
returns to what the feature is available.
This aims that programs which use libarchive shouldn't have to
to know what features are available on a particular platform.
Tim Kientzle [Wed, 7 Jan 2009 06:38:55 +0000 (01:38 -0500)]
Start of archive_read_disk API.
Right now, this is just a handle for username/group name lookups
and the associated caches. Soon, this will hold machinery to
populate archive_entry objects from files on disk (which relies
on efficient uname/gname lookups).
Tim Kientzle [Wed, 7 Jan 2009 05:15:09 +0000 (00:15 -0500)]
Correct a very minor memory leak in test/main.c.
Exiting on an illegal argument failed to free the
allocated buffer holding the path of the reference directory.
Tim Kientzle [Wed, 7 Jan 2009 05:12:07 +0000 (00:12 -0500)]
Fix the filter close handling. Since the archive_read core
creates the filter object, it should also free it. This
also corrects a small memory leak in
archive_read_support_compression_program.
On Windows, remove fstat64()/get_dev_ino()/
get_dev_ino_fd()/get_dev_ino_filename().
Those functions are no longer needed. now we can
use la_stat() instead of fstat64() when defined
__USE_LARGEFILE and __USE_FILE_OFFSET64.
On Windows, support long path name which is longer
than MAX_PATH(260). And add relationally new
features.
- Many file io functions such as open/mkdir/rmdir..etc
are replaced. Some new functions are using Win32 API
directly, some ones are wrapped orignal function.
- Add new feature to new stat() family.
1. set st_ino data by nFileIndexHigh and
nFileIndexLow of BY_HANDLE_FILE_INFORMATION.
2. set st_nlink data by nNumberOfLinks of
BY_HANDLE_FILE_INFORMATION.
3. set st_dev data by dwVolumeSerialNumber by
BY_HANDLE_FILE_INFORMATION.
- Rewrite link() function and add suuport hard-link.
- The new open() function has been changed error
handling to sumulate other POSIX systems.