[Cmake-commits] CMake branch, next, updated. v2.8.2-429-gb053112
Eric Noulard
eric.noulard at gmail.com
Sat Aug 14 04:54:54 EDT 2010
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via b0531123e405d3d6daca72894734215fdae20170 (commit)
via 1a3ad5c615be02cd18fe8e166b16ee15f821df72 (commit)
via b50c15915ac5cca79e00bf438dacd074fe531978 (commit)
from 2e65a1fa543e4e148eccfab4d99287c9b1bf386a (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b0531123e405d3d6daca72894734215fdae20170
commit b0531123e405d3d6daca72894734215fdae20170
Merge: 2e65a1f 1a3ad5c
Author: Eric Noulard <eric.noulard at gmail.com>
AuthorDate: Sat Aug 14 04:54:52 2010 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Sat Aug 14 04:54:52 2010 -0400
Merge topic 'libarchive-wrapper' into next
1a3ad5c Add XZ compress support to libarchive-wrapper
b50c159 Add ZIP archive format and LZMA compress support to libarchive-wrapper
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1a3ad5c615be02cd18fe8e166b16ee15f821df72
commit 1a3ad5c615be02cd18fe8e166b16ee15f821df72
Author: Eric NOULARD <eric.noulard at gmail.com>
AuthorDate: Fri Aug 13 17:51:27 2010 +0200
Commit: Eric NOULARD <eric.noulard at gmail.com>
CommitDate: Fri Aug 13 17:51:27 2010 +0200
Add XZ compress support to libarchive-wrapper
This is not needed but it does not cost much to do it for all
potentially supported format in libarchive. XZ and LZMA are not
builtin libarchive and require external lib but if
CMAKE_USE_SYSTEM_LIBARCHIVE is ON then we may get it for free.
diff --git a/Source/cmArchiveWrite.cxx b/Source/cmArchiveWrite.cxx
index bea9586..524e53e 100644
--- a/Source/cmArchiveWrite.cxx
+++ b/Source/cmArchiveWrite.cxx
@@ -87,6 +87,14 @@ cmArchiveWrite::cmArchiveWrite(std::ostream& os, Compress c, Type t):
return;
}
break;
+ case CompressXZ:
+ if(archive_write_set_compression_xz(this->Archive) != ARCHIVE_OK)
+ {
+ this->Error = "archive_write_set_compression_xz: ";
+ this->Error += archive_error_string(this->Archive);
+ return;
+ }
+ break;
};
#if !defined(_WIN32) || defined(__CYGWIN__)
if (archive_read_disk_set_standard_lookup(this->Disk) != ARCHIVE_OK)
diff --git a/Source/cmArchiveWrite.h b/Source/cmArchiveWrite.h
index 0bd3e9b..ce7f961 100644
--- a/Source/cmArchiveWrite.h
+++ b/Source/cmArchiveWrite.h
@@ -33,7 +33,8 @@ public:
CompressNone,
CompressGZip,
CompressBZip2,
- CompressLZMA
+ CompressLZMA,
+ CompressXZ
};
/** Archive Type */
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b50c15915ac5cca79e00bf438dacd074fe531978
commit b50c15915ac5cca79e00bf438dacd074fe531978
Author: Eric NOULARD <eric.noulard at gmail.com>
AuthorDate: Fri Aug 13 17:49:47 2010 +0200
Commit: Eric NOULARD <eric.noulard at gmail.com>
CommitDate: Fri Aug 13 17:49:47 2010 +0200
Add ZIP archive format and LZMA compress support to libarchive-wrapper
This will be needed to use cmArchiveWrire in cmCPackArchiveGenerator
with the same feature set as before. Note that adding zip
support to libarchive-wrapper would also makes it easy to add
a new -E zip command to cmake commands.
diff --git a/Source/cmArchiveWrite.cxx b/Source/cmArchiveWrite.cxx
index 94c97e6..bea9586 100644
--- a/Source/cmArchiveWrite.cxx
+++ b/Source/cmArchiveWrite.cxx
@@ -47,7 +47,7 @@ struct cmArchiveWrite::Callback
};
//----------------------------------------------------------------------------
-cmArchiveWrite::cmArchiveWrite(std::ostream& os, Compress c):
+cmArchiveWrite::cmArchiveWrite(std::ostream& os, Compress c, Type t):
Stream(os),
Archive(archive_write_new()),
Disk(archive_read_disk_new()),
@@ -79,11 +79,47 @@ cmArchiveWrite::cmArchiveWrite(std::ostream& os, Compress c):
return;
}
break;
+ case CompressLZMA:
+ if(archive_write_set_compression_lzma(this->Archive) != ARCHIVE_OK)
+ {
+ this->Error = "archive_write_set_compression_lzma: ";
+ this->Error += archive_error_string(this->Archive);
+ return;
+ }
+ break;
};
- archive_read_disk_set_standard_lookup(this->Disk);
- if(archive_write_set_format_pax_restricted(this->Archive) != ARCHIVE_OK)
+#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
+ switch (t)
+ {
+ case TypeZIP:
+ if(archive_write_set_format_zip(this->Archive) != ARCHIVE_OK)
+ {
+ this->Error = "archive_write_set_format_zip: ";
+ this->Error += archive_error_string(this->Archive);
+ return;
+ }
+ break;
+ case TypeTAR:
+ if(archive_write_set_format_pax_restricted(this->Archive) != ARCHIVE_OK)
+ {
+ this->Error = "archive_write_set_format_pax_restricted: ";
+ this->Error += archive_error_string(this->Archive);
+ return;
+ }
+ break;
+ }
+
+ // 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_write_set_bytes_in_last_block: ";
this->Error += archive_error_string(this->Archive);
return;
}
diff --git a/Source/cmArchiveWrite.h b/Source/cmArchiveWrite.h
index 92c0c73..0bd3e9b 100644
--- a/Source/cmArchiveWrite.h
+++ b/Source/cmArchiveWrite.h
@@ -32,11 +32,19 @@ public:
{
CompressNone,
CompressGZip,
- CompressBZip2
+ CompressBZip2,
+ CompressLZMA
+ };
+
+ /** Archive Type */
+ enum Type
+ {
+ TypeTAR,
+ TypeZIP
};
/** Construct with output stream to which to write archive. */
- cmArchiveWrite(std::ostream& os, Compress c = CompressNone);
+ cmArchiveWrite(std::ostream& os, Compress c = CompressNone, Type = TypeTAR);
~cmArchiveWrite();
/**
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index a26452c..0e0a770 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -1732,7 +1732,8 @@ bool cmSystemTools::CreateTar(const char* outFileName,
}
cmArchiveWrite a(fout, (gzip? cmArchiveWrite::CompressGZip :
(bzip2? cmArchiveWrite::CompressBZip2 :
- cmArchiveWrite::CompressNone)));
+ cmArchiveWrite::CompressNone)),
+ cmArchiveWrite::TypeTAR);
a.SetVerbose(verbose);
for(std::vector<cmStdString>::const_iterator i = files.begin();
i != files.end(); ++i)
-----------------------------------------------------------------------
Summary of changes:
Source/cmArchiveWrite.cxx | 52 +++++++++++++++++++++++++++++++++++++++++---
Source/cmArchiveWrite.h | 13 +++++++++-
Source/cmSystemTools.cxx | 3 +-
3 files changed, 61 insertions(+), 7 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list