Tim Kientzle [Sun, 13 Mar 2011 07:43:36 +0000 (03:43 -0400)]
Fix the handling of multiple Fl options:
.Fl Fl command
used to cause -Fl command but now it generates --command.
In the process, bolding of certain command options is
lost; the logic here needs to be significantly reworked.
Tim Kientzle [Sun, 13 Mar 2011 05:36:55 +0000 (00:36 -0500)]
Issue 141: Detect an unrecognized format earlier, in archive_read_open,
instead of waiting until we try to read the first header.
This just required moving the format detection into archive_read_open.
This in turn required updating a some tests that inadvertently
relied on the old behavior.
While poking around in the truncation tests, I went ahead and
updated them to not use the old "assertA" macro, which is
deprecated.
Tim Kientzle [Sat, 12 Mar 2011 08:26:09 +0000 (03:26 -0500)]
Move the -Werror -Wall switches to the top and set them for try-compiles
as well.
Before this, there were problems with iconv(), which has variants on different
systems that differ only in const usage; the try-compiles would
pass with the wrong const usage and cause the build to fail.
Setting -Werror on the try-compiles ensures that this doesn't happen.
Björn Jacke [Fri, 18 Feb 2011 02:08:33 +0000 (21:08 -0500)]
DO NOT USE C++ style comments like // in C code !
Not all C compilers are happy with them, lxc on AIX for example.
There are much more of them in the testing code but the ones
fixed with this commit make at least the most important things compile.
Björn Jacke [Wed, 16 Feb 2011 19:26:46 +0000 (14:26 -0500)]
on Tru64 use the F_SETTIMES fcntl to restore timestamps.
The advantage is that we will even be able to restore ctimes with that.
We need to run as root however to be able to do that.
Tim Kientzle [Sat, 12 Feb 2011 19:23:29 +0000 (14:23 -0500)]
Restore basic documentation for archive_read_finish
and archive_write_finish so that developers who need
to support libarchive 2.x won't be too confused
by the name change.
Simply set -1 to a file offset not to appear before any directories;
some version of xorriso set its parent directory offset to the offset
of empty files.
Add a test for reading the iso images made by that xorriso.
Tim Kientzle [Sun, 6 Feb 2011 05:45:30 +0000 (00:45 -0500)]
Followup on Issue 134:
1) Port test_open_failure to libarchive 2.8 branch to test
the problem reported in Issue 134.
This test also shows that archive_read_open() sometimes
fails to report open errors correctly.
2) Fix the bug in archive_read.c
3) Comment out the tests that close functions are invoked
promptly when open fails; that's fully fixed in libarchive 3.0,
but I don't think it's worth fixing here.
Properly restore birthtime on Windows; use W32API directly in
archive_write_disk.c and remove __la_futimes()/__la_utimes()
functions and related definitions, which were used in
archive_write_disk.c only.
Improve checking of statfs in LSB.
Use HAVE_SYS_STATFS_H to use statfs on linux instead of HAVE_SYS_VFS_H
and add checking of HAVE_SYS_STATVFS_H to use statvfs.
Tim Kientzle [Mon, 24 Jan 2011 04:57:05 +0000 (23:57 -0500)]
When fetching the file contents from disk, obey local system
limitations. (This should probably be rewritten to use
archive_read_disk_entry_from_file().)
Tim Kientzle [Mon, 24 Jan 2011 04:55:26 +0000 (23:55 -0500)]
Start using int64_t for uid/gid variables and int for mode variables.
The case to consider here is when a system with narrow types is
used to modify an archive that was created and will later be extracted
on a system with wide types. If we're not actually dealing with
the local filesystem, we should not be constrained by its limitations.
If the offset of a file entry is zero, set -1 to the offset, which is
calculated from its location, to make sure the entry will appear after
directory entries.
Some ISO image writer(xorriso) set zero to the location of a symlink entry.
It causes that our ISO-reader cannot read following directory entries at all
since we expect directory entries is located before file entries and we
are sorting all entry in an ISO image by the offset to read the contents
of the entries in stream.
Tim Kientzle [Sun, 23 Jan 2011 06:14:21 +0000 (01:14 -0500)]
Ensure that int64_t, int32_t, int16_t, intmax_t, uint64_t, uint32_t,
uint16_t, and uintmax_t are all defined by probing the available
integer types and their sizes during the configure, then using that
information to typedef the required types at compile time.
On Windows, set 'Creation time' to both birthtime and ctime, because
CRT stat() Microsoft provides set 'Creation time' to st_ctime.
It seems we should do that not to confuse applications about ctime.
Tim Kientzle [Sat, 22 Jan 2011 23:05:58 +0000 (18:05 -0500)]
Eliminate a bunch of off_t uses.
Most of these are from the libarchive 2 API that's no longer supported.
A few are places where int64_t offsets need to be mapped down to system
APIs that might only be 32 bits; those are a little trickier.
Do not set a default value to struct fileystem.xfer_align and related
variables when we could not get a filesystem alignment because of a lack
of statfs/statvfs family of functions to know what we can trust the alignment.
Reduce performing fchdir().
For example, when the disk read object was opened with
archive_read_disk_open("file.txt")(not a directory),
performing fchdir() is really unneeded.