summaryrefslogtreecommitdiffstats
path: root/Source/CPack/cmCPackTarBZip2Generator.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2007-02-02 19:40:26 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2007-02-02 19:40:26 (GMT)
commit4925e64b97b46b7248b7fe7ffa9fb215ca2d460f (patch)
tree9f5590a4240a1abc5762dcfdcca4faaf544b7d66 /Source/CPack/cmCPackTarBZip2Generator.cxx
parent1feb4a09b078452c42e74a1caeb432f6ccc7da68 (diff)
downloadCMake-4925e64b97b46b7248b7fe7ffa9fb215ca2d460f.zip
CMake-4925e64b97b46b7248b7fe7ffa9fb215ca2d460f.tar.gz
CMake-4925e64b97b46b7248b7fe7ffa9fb215ca2d460f.tar.bz2
ENH: add support for cygwin source and binary packaging
Diffstat (limited to 'Source/CPack/cmCPackTarBZip2Generator.cxx')
-rw-r--r--Source/CPack/cmCPackTarBZip2Generator.cxx40
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 ) )
{