diff options
Diffstat (limited to 'Source/CPack/cmCPackTarBZip2Generator.cxx')
-rw-r--r-- | Source/CPack/cmCPackTarBZip2Generator.cxx | 40 |
1 files changed, 26 insertions, 14 deletions
diff --git a/Source/CPack/cmCPackTarBZip2Generator.cxx b/Source/CPack/cmCPackTarBZip2Generator.cxx index 17efda5..7a52afd 100644 --- a/Source/CPack/cmCPackTarBZip2Generator.cxx +++ b/Source/CPack/cmCPackTarBZip2Generator.cxx @@ -66,27 +66,17 @@ int cmCPackTarBZip2Generator::InitializeInternal() } //---------------------------------------------------------------------- -int cmCPackTarBZip2Generator::CompressFiles(const char* outFileName, - const char* toplevel, const std::vector<std::string>& files) +int cmCPackTarBZip2Generator::BZip2File(const char* packageDirFileName) { - std::string packageDirFileName - = this->GetOption("CPACK_TEMPORARY_DIRECTORY"); - packageDirFileName += ".tar"; - std::string output; - int retVal = -1; - if ( !this->Superclass::CompressFiles(packageDirFileName.c_str(), - toplevel, files) ) - { - return 0; - } - + int retVal = 0; cmOStringStream dmgCmd1; dmgCmd1 << "\"" << this->GetOption("CPACK_INSTALLER_PROGRAM") << "\" \"" << packageDirFileName << "\""; retVal = -1; + std::string output; int res = cmSystemTools::RunSingleCommand(dmgCmd1.str().c_str(), &output, - &retVal, toplevel, this->GeneratorVerbose, 0); + &retVal, 0, this->GeneratorVerbose, 0); if ( !res || retVal ) { std::string tmpFile = this->GetOption("CPACK_TOPLEVEL_DIRECTORY"); @@ -100,7 +90,29 @@ int cmCPackTarBZip2Generator::CompressFiles(const char* outFileName, << "Please check " << tmpFile.c_str() << " for errors" << std::endl); return 0; } + return 1; +} + +//---------------------------------------------------------------------- +int cmCPackTarBZip2Generator::CompressFiles(const char* outFileName, + const char* toplevel, const std::vector<std::string>& files) +{ + std::string packageDirFileName + = this->GetOption("CPACK_TEMPORARY_DIRECTORY"); + packageDirFileName += ".tar"; + std::string output; + int retVal = -1; + if ( !this->Superclass::CompressFiles(packageDirFileName.c_str(), + toplevel, files) ) + { + return 0; + } + if(!this->BZip2File(packageDirFileName.c_str())) + { + return 0; + } + std::string compressOutFile = packageDirFileName + ".bz2"; if ( !cmSystemTools::SameFile(compressOutFile.c_str(), outFileName ) ) { |