diff options
author | Eric NOULARD <eric.noulard@gmail.com> | 2010-08-11 17:48:39 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2010-08-11 18:09:52 (GMT) |
commit | cd7b8a03f5403603da44432470f177601b5bf42b (patch) | |
tree | 4527678b66fe7a43415b538c989e061b0148fe8c /Source/CPack/cmCPackCygwinSourceGenerator.cxx | |
parent | 7c20f7b244c98b177e0eca13b3617c83d4691a77 (diff) | |
download | CMake-cd7b8a03f5403603da44432470f177601b5bf42b.zip CMake-cd7b8a03f5403603da44432470f177601b5bf42b.tar.gz CMake-cd7b8a03f5403603da44432470f177601b5bf42b.tar.bz2 |
CPack: Refactor API in order to handle multi-file packages
The multi-argument CompressFiles(...) method has been replace by the
no-argument PackageFiles() method and 3 more member variables. This
will enable implemention of multi-package generators. Now each specific
generator (which overloads PackageFiles()) may decide to change the name
and/or the number of generated package files.
Diffstat (limited to 'Source/CPack/cmCPackCygwinSourceGenerator.cxx')
-rw-r--r-- | Source/CPack/cmCPackCygwinSourceGenerator.cxx | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/Source/CPack/cmCPackCygwinSourceGenerator.cxx b/Source/CPack/cmCPackCygwinSourceGenerator.cxx index cca8338..f4ae35f 100644 --- a/Source/CPack/cmCPackCygwinSourceGenerator.cxx +++ b/Source/CPack/cmCPackCygwinSourceGenerator.cxx @@ -48,21 +48,19 @@ int cmCPackCygwinSourceGenerator::InitializeInternal() } //---------------------------------------------------------------------- -int cmCPackCygwinSourceGenerator::CompressFiles(const char* outFileName, - const char* toplevel, const std::vector<std::string>& files) +int cmCPackCygwinSourceGenerator::PackageFiles() { // Create a tar file of the sources std::string packageDirFileName = this->GetOption("CPACK_TEMPORARY_DIRECTORY"); packageDirFileName += ".tar.bz2"; + packageFileNames[0] = packageDirFileName; std::string output; // skip one parent up to the cmCPackTarBZip2Generator // to create tar.bz2 file with the list of source // files this->Compress = BZIP2; - if ( !this->cmCPackTarBZip2Generator:: - CompressFiles(packageDirFileName.c_str(), - toplevel, files) ) + if ( !this->cmCPackTarBZip2Generator::PackageFiles() ) { return 0; } @@ -135,21 +133,25 @@ int cmCPackCygwinSourceGenerator::CompressFiles(const char* outFileName, patchFile += "/"; patchFile += cmSystemTools::GetFilenameName( this->GetOption("CPACK_CYGWIN_PATCH_FILE")); - std::vector<std::string> outerFiles; + std::string file = cmSystemTools::GetFilenameName(compressOutFile); std::string sourceTar = cmSystemTools::GetFilenamePath(compressOutFile); sourceTar += "/"; sourceTar += file; + /* reset list of file to be packaged */ + files.clear(); // a source release in cygwin should have the build script used // to build the package, the patch file that is different from the // regular upstream version of the sources, and a bziped tar file // of the original sources - outerFiles.push_back(buildScript); - outerFiles.push_back(patchFile); - outerFiles.push_back(sourceTar); - if ( !this->cmCPackTarBZip2Generator:: - CompressFiles(outerTarFile.c_str(), - tmpDir.c_str(), outerFiles) ) + files.push_back(buildScript); + files.push_back(patchFile); + files.push_back(sourceTar); + /* update the name of the produced package */ + packageFileNames[0] = outerTarFile; + /* update the toplevel dir */ + toplevel = tmpDir; + if ( !this->cmCPackTarBZip2Generator::PackageFiles() ) { return 0; } |