[cmake-developers] Adding ZIP and LZMA compression support to libarchive-wrapper
Eric Noulard
eric.noulard at gmail.com
Thu Aug 12 17:36:49 EDT 2010
Brad,
I began working on backporting my previous cmCPackArchiveGenerator component
support to redesigned CPackAPI **and** the use of libarchive-wrapper (step3).
The current libarchive-wrapper is missing:
- support for ZIP archive which is needed
- support for LZMA compression which not needed since not used
Those change would bring the same features set as the current
cmCPackArchiveGenerator
which does not rely on libarchive-wrapper but directly calls libarchive.
This is the first patch.
I added a second patch for support for XZ compression because
when we are at it, this does not cost much and will bring more
compression options
as soon as CMAKE_USE_SYSTEM_LIBARCHIVE is ON.
This may help to solve this bug afterwards:
see eg: http://public.kitware.com/Bug/view.php?id=11040
As you will see I added some mysterious changes directly coming
from the current cmCPackArchiveGenerator.cxx.
Most notably:
#if !defined(_WIN32) || defined(__CYGWIN__)
if (archive_read_disk_set_standard_lookup(this->Disk) != ARCHIVE_OK)
{
this->Error = "archive_read_disk_set_standard_lookup: ";
this->Error += archive_error_string(this->Archive);
return;;
}
#endif
which wasn't conditional before. Since the call has no error check before
it may have been failing silently on _WIN32 and __CYGWIN....?
Other thing I just "copy/paste" was the 'not padding last block thing':
// do not pad the last block!!
if (archive_write_set_bytes_in_last_block(this->Archive, 1))
{
this->Error = "archive_write_set_format_pax_restricted: ";
this->Error += archive_error_string(this->Archive);
return;
}
Even with those changes the whole CMake testsuite is ok.
(obviously I miss some Win32 / Cygwin tests).
Now that I am fully aware of "stage" I may push those to your
libarchive-wrapper stage if you want.
May not be tonight because it's getting late :-]
--
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-ZIP-archive-format-and-LZMA-compress-support-to-.patch
Type: text/x-diff
Size: 4151 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20100812/855fc690/attachment-0004.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Add-XZ-compress-support-to-libarchive-wrapper.patch
Type: text/x-diff
Size: 1671 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20100812/855fc690/attachment-0005.patch>
More information about the cmake-developers
mailing list