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.
Do not call __archive_errx function in POISX functions
replaced or implemented on Windows. Consider those
functions are used by bsdtar or bsdcpio. Or those ones
copy to bsdtar or bsdcpio easily.
Tim Kientzle [Sat, 14 Feb 2009 07:51:43 +0000 (02:51 -0500)]
Move some of the autoconf support files into build/autoconf.
It should be possible to move a lot more of the autoconf support
files (including Makefile.in, autom4te.cache, etc) into
build/autoconf, but I haven't found any way to do this.
Tim Kientzle [Sat, 14 Feb 2009 00:03:30 +0000 (19:03 -0500)]
Clean up the top level a bit by moving the auxiliary cmake files down into
build/cmake and the windows build files down into build/windows.
I intend to do the same with the autoconf files, but that will
require a little more creativity.
Do not regard a read data in which a character '\n'
isn't included as last block of a mtree file or
last line of a entry. A data returned by the
__archive_read_ahead function isn't always includeing
the character '\n' if following datas have it.
Improve /set keyword handling in mtree.
When a parent directory is changed, check datas written with
/set keyword and write it again if its values are different from
current entry's, except directory-only mode.
Tim Kientzle [Mon, 9 Feb 2009 05:59:03 +0000 (00:59 -0500)]
Get this to compile on Mac OS. It looks like Mac OS
xattr support is close to Linux, so it may be easy to
get this to work. For now, though, I've just added
in enough configuration checks so it doesn't try to build
the xattr support.