summaryrefslogtreecommitdiffstats
path: root/Source/cmSystemTools.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-01-12 14:39:40 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2015-01-12 14:39:40 (GMT)
commitd9a6ea4599eb3b736b4e695a9ffd5d8a51eac059 (patch)
treef6b9656a5e81537352b5edfe158abff8c68fd2c4 /Source/cmSystemTools.cxx
parent212bf1f82a522b7ee779b008a14c2e51fd104e5b (diff)
parent4035ef786de80d4d2fc27cd5f03c629702f54762 (diff)
downloadCMake-d9a6ea4599eb3b736b4e695a9ffd5d8a51eac059.zip
CMake-d9a6ea4599eb3b736b4e695a9ffd5d8a51eac059.tar.gz
CMake-d9a6ea4599eb3b736b4e695a9ffd5d8a51eac059.tar.bz2
Merge topic 'add-xz-support'
4035ef78 cmake -E tar: error out on multiple compression formats d811d238 cmSystemTools: use an enumeration for compression formats df16dcfb cmake -E tar: add support for .xz files with 'J' b0a5d393 cmake -E tar: clean up flag documentation
Diffstat (limited to 'Source/cmSystemTools.cxx')
-rw-r--r--Source/cmSystemTools.cxx29
1 files changed, 21 insertions, 8 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index fb973d4..eea4986 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -1474,7 +1474,8 @@ bool cmSystemTools::IsPathToFramework(const char* path)
bool cmSystemTools::CreateTar(const char* outFileName,
const std::vector<std::string>& files,
- bool gzip, bool bzip2, bool verbose)
+ cmTarCompression compressType,
+ bool verbose)
{
#if defined(CMAKE_BUILD_WITH_CMAKE)
std::string cwd = cmSystemTools::GetCurrentWorkingDirectory();
@@ -1488,10 +1489,24 @@ bool cmSystemTools::CreateTar(const char* outFileName,
cmSystemTools::Error(e.c_str());
return false;
}
- cmArchiveWrite a(fout, (gzip? cmArchiveWrite::CompressGZip :
- (bzip2? cmArchiveWrite::CompressBZip2 :
- cmArchiveWrite::CompressNone)),
- cmArchiveWrite::TypeTAR);
+ cmArchiveWrite::Compress compress = cmArchiveWrite::CompressNone;
+ switch (compressType)
+ {
+ case TarCompressGZip:
+ compress = cmArchiveWrite::CompressGZip;
+ break;
+ case TarCompressBZip2:
+ compress = cmArchiveWrite::CompressBZip2;
+ break;
+ case TarCompressXZ:
+ compress = cmArchiveWrite::CompressXZ;
+ break;
+ case TarCompressNone:
+ compress = cmArchiveWrite::CompressNone;
+ break;
+ }
+ cmArchiveWrite a(fout, compress,
+ cmArchiveWrite::TypeTAR);
a.SetVerbose(verbose);
for(std::vector<std::string>::const_iterator i = files.begin();
i != files.end(); ++i)
@@ -1516,7 +1531,6 @@ bool cmSystemTools::CreateTar(const char* outFileName,
#else
(void)outFileName;
(void)files;
- (void)gzip;
(void)verbose;
return false;
#endif
@@ -1777,7 +1791,7 @@ bool extract_tar(const char* outFileName, bool verbose,
#endif
bool cmSystemTools::ExtractTar(const char* outFileName,
- bool , bool verbose)
+ bool verbose)
{
#if defined(CMAKE_BUILD_WITH_CMAKE)
return extract_tar(outFileName, verbose, true);
@@ -1789,7 +1803,6 @@ bool cmSystemTools::ExtractTar(const char* outFileName,
}
bool cmSystemTools::ListTar(const char* outFileName,
- bool ,
bool verbose)
{
#if defined(CMAKE_BUILD_WITH_CMAKE)