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).
On Windows, rewrite permissive_name function.
GetFullPathName Windows API does not always
return a full path name start with drive letters
such as "c:\". It wasn't that permissive_name
function had expected.
e.g.
When we changed a current directory by "//./c:/path-to"
and got a full path name of "file" by GetFullPathName,
GetFullPathName API returned "\\.\c:\path-to\file"
not "c:\path-to\file". And then permissive_name
returned "\\?\\\.\c:\path-to\file" (wrong path).
Tweak a mtree format test.
Make directories for through the routine which open
a directory in reading a mtree format.
If we don't make directories, the routine won't try
to open the directory.
Tim Kientzle [Mon, 23 Feb 2009 03:05:20 +0000 (22:05 -0500)]
Issue 5: On Windows, convert illegal filename characters to '_'.
Among other things, this removes a pain point when
extracting non-Windows tar archives on Windows platforms.
(Note: submitted patch was accidentally attached to Issue 6.)
Tim Kientzle [Mon, 23 Feb 2009 01:47:28 +0000 (20:47 -0500)]
Make the current time be an argument to get_date(), to facilitate
testing. In particular, this should make it easier to test
relative time names such as "3am next tuesday".
Tim Kientzle [Mon, 23 Feb 2009 01:14:58 +0000 (20:14 -0500)]
Lots of comments, some minor code restructuring and cleanup.
One structural change: timezones are now represented as seconds
offset from GMT, which makes everything a tad more consistent.
Tim Kientzle [Sun, 22 Feb 2009 07:54:25 +0000 (02:54 -0500)]
No more YACC: Translated the old getdate.y into a recursive-descent
parser in plain C. Should recognize exactly the same date specifications
as the former YACC version.
Tim Kientzle [Sun, 22 Feb 2009 06:30:59 +0000 (01:30 -0500)]
Another step in refactoring getdate.y: We now tokenize the
entire string, then return elements from the token array.
This will greatly simplify handling look-ahead in the next
refactoring step.
Tim Kientzle [Sun, 22 Feb 2009 06:23:03 +0000 (01:23 -0500)]
Towards a yacc-less bsdtar: Push some bookkeeping down towards the
leaves, which gets us closer to a simple "phrase book" structure for
the grammar. Isolate a stateless tokenizer that can be used in other
ways.
Tim Kientzle [Sat, 21 Feb 2009 19:19:33 +0000 (14:19 -0500)]
Check in getdate.c and getdate.h.
On systems that have Yacc or Bison, these are constructed from
getdate.y. However, as we push the portability envelope, we're
encountering more systems that don't have Yacc/Bison and the
lack of these files is making it difficult for people on those
platforms to contribute.
Eventually, I'd like to rewrite getdate() into straight C
and lose the Yacc dependency entirely, but I'm not quite
ready for that.
On Windows, Avoid la_open function returning error
when we open a direcotry with O_RDONLY mode.
A behavior of la_open function is close to
the POSIX open function.
Windows shell whose name is command.exe/cmd.exe does not
deal with wildcard characters '*' and '?'.
Windows application should handle those characters by
FindFirstFile() Win32 API for usability.
Tim Kientzle [Fri, 20 Feb 2009 07:09:03 +0000 (02:09 -0500)]
If we don't have yacc or bison, just warn and continue.
In particular, most Windows folks don't have it; that's why
we include pre-built getdate.c/getdate.h in the shipped packages.
Tim Kientzle [Wed, 18 Feb 2009 05:59:34 +0000 (00:59 -0500)]
Issue 8: Compression name should be "none" if we're reading
an uncompressed archive. Fill in assertions to verify textual
name for various compression formats.
Tim Kientzle [Wed, 18 Feb 2009 05:46:34 +0000 (00:46 -0500)]
Issue 7: Only flush and close the file if the file was actually
opened. Add a test for this case and update all the build systems.
(Note: the FreeBSD-specific Makefiles should be removed; three
build systems is too many.)
Skip symlink tests on Windows.
Now, all bsdtar tests passed on Windows.
Results are:
0 of 13 tests reported failures
Total of 84126 assertions checked.
Total of 0 assertions failed.
Total of 9 assertions skipped.