summaryrefslogtreecommitdiff
path: root/Source/CPack/cmCPackArchiveGenerator.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2009-11-03 09:40:57 -0500
committerBill Hoffman <bill.hoffman@kitware.com>2009-11-03 09:40:57 -0500
commit78b2d5097cc3b5d96f67d3f90ca92f7418043bc0 (patch)
treef855d0d44f9a5d239fc83284accc6172ae708537 /Source/CPack/cmCPackArchiveGenerator.cxx
parent1b1d954f7ec2aa49a0eccefed1a5b2b11886fd06 (diff)
downloadcmake-78b2d5097cc3b5d96f67d3f90ca92f7418043bc0.tar.gz
Fix cygwin package stuff to work with libarchive
Diffstat (limited to 'Source/CPack/cmCPackArchiveGenerator.cxx')
-rw-r--r--Source/CPack/cmCPackArchiveGenerator.cxx38
1 files changed, 23 insertions, 15 deletions
diff --git a/Source/CPack/cmCPackArchiveGenerator.cxx b/Source/CPack/cmCPackArchiveGenerator.cxx
index ef4fff9fad..e6a83b13fc 100644
--- a/Source/CPack/cmCPackArchiveGenerator.cxx
+++ b/Source/CPack/cmCPackArchiveGenerator.cxx
@@ -49,8 +49,25 @@ bool SetArchiveType(struct archive* a,
cmCPackArchiveGenerator::CompressType ct,
cmCPackArchiveGenerator::ArchiveType at)
{
- // pick a compression type
int res;
+ // pick the archive type
+ switch(at)
+ {
+ case cmCPackArchiveGenerator::TAR:
+ // maybe this:
+ //res = archive_write_set_format_pax(a);
+ res = archive_write_set_format_ustar(a); // is this what we want?
+ break;
+ case cmCPackArchiveGenerator::ZIP:
+ res = archive_write_set_format_zip(a);
+ break;
+ }
+ if(res != ARCHIVE_OK)
+ {
+ return false;
+ }
+
+ // pick a compression type
switch(ct)
{
case cmCPackArchiveGenerator::GZIP:
@@ -68,27 +85,18 @@ bool SetArchiveType(struct archive* a,
case cmCPackArchiveGenerator::NONE:
default:
res = archive_write_set_compression_none(a);
- }
+ }
if(res != ARCHIVE_OK)
{
return false;
}
- // pick the archive type
- switch(at)
- {
- case cmCPackArchiveGenerator::TAR:
- // maybe this:
- // archive_write_set_format_pax(a);
- res = archive_write_set_format_ustar(a); // is this what we want?
- break;
- case cmCPackArchiveGenerator::ZIP:
- res = archive_write_set_format_zip(a);
- break;
- }
+ // do not pad the last block!!
+ res = archive_write_set_bytes_in_last_block(a, 1);
if(res != ARCHIVE_OK)
{
return false;
}
+
return true;
}
@@ -201,7 +209,7 @@ int cmCPackArchiveGenerator::CompressFiles(const char* outFileName,
if(!file)
{
cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem with fopen(): "
- << file
+ << fileIt->c_str()
<< strerror(errno)
<< std::endl);
return 0;