diff options
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; |