diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2015-01-09 15:33:00 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-01-12 14:36:25 (GMT) |
commit | d811d238abe2dcd04cebd7ee4c3f07f4b6da093f (patch) | |
tree | 2ae34f0ac5f6a84452a359d36d22e5760791b557 /Source/cmcmd.cxx | |
parent | df16dcfb4478bb05932a1abb0e42433e60f1a565 (diff) | |
download | CMake-d811d238abe2dcd04cebd7ee4c3f07f4b6da093f.zip CMake-d811d238abe2dcd04cebd7ee4c3f07f4b6da093f.tar.gz CMake-d811d238abe2dcd04cebd7ee4c3f07f4b6da093f.tar.bz2 |
cmSystemTools: use an enumeration for compression formats
Juggling 3 booleans was unwieldy.
Diffstat (limited to 'Source/cmcmd.cxx')
-rw-r--r-- | Source/cmcmd.cxx | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index 6b3efb5..91b9e94 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -733,21 +733,20 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args) { files.push_back(args[cc]); } - bool gzip = false; - bool bzip2 = false; - bool xz = false; + cmSystemTools::cmTarCompression compress = + cmSystemTools::TarCompressNone; bool verbose = false; if ( flags.find_first_of('j') != flags.npos ) { - bzip2 = true; + compress = cmSystemTools::TarCompressBZip2; } if ( flags.find_first_of('J') != flags.npos ) { - xz = true; + compress = cmSystemTools::TarCompressXZ; } if ( flags.find_first_of('z') != flags.npos ) { - gzip = true; + compress = cmSystemTools::TarCompressGZip; } if ( flags.find_first_of('v') != flags.npos ) { @@ -756,7 +755,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args) if ( flags.find_first_of('t') != flags.npos ) { - if ( !cmSystemTools::ListTar(outFile.c_str(), gzip, verbose) ) + if ( !cmSystemTools::ListTar(outFile.c_str(), verbose) ) { cmSystemTools::Error("Problem creating tar: ", outFile.c_str()); return 1; @@ -765,7 +764,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args) else if ( flags.find_first_of('c') != flags.npos ) { if ( !cmSystemTools::CreateTar( - outFile.c_str(), files, gzip, bzip2, xz, verbose) ) + outFile.c_str(), files, compress, verbose) ) { cmSystemTools::Error("Problem creating tar: ", outFile.c_str()); return 1; @@ -774,7 +773,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args) else if ( flags.find_first_of('x') != flags.npos ) { if ( !cmSystemTools::ExtractTar( - outFile.c_str(), gzip, verbose) ) + outFile.c_str(), verbose) ) { cmSystemTools::Error("Problem extracting tar: ", outFile.c_str()); return 1; |