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/cmCPackDebGenerator.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/cmCPackDebGenerator.cxx')
-rw-r--r-- | Source/CPack/cmCPackDebGenerator.cxx | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/Source/CPack/cmCPackDebGenerator.cxx b/Source/CPack/cmCPackDebGenerator.cxx index a8fed1d..58c6dc3 100644 --- a/Source/CPack/cmCPackDebGenerator.cxx +++ b/Source/CPack/cmCPackDebGenerator.cxx @@ -48,9 +48,7 @@ int cmCPackDebGenerator::InitializeInternal() } //---------------------------------------------------------------------- -int cmCPackDebGenerator::CompressFiles(const char* outFileName, - const char* toplevel, - const std::vector<std::string>& files) +int cmCPackDebGenerator::PackageFiles() { this->ReadListFile("CPackDeb.cmake"); const char* cmakeExecutable = this->GetOption("CMAKE_COMMAND"); @@ -141,7 +139,7 @@ int cmCPackDebGenerator::CompressFiles(const char* outFileName, // now add all directories which have to be compressed // collect all top level install dirs for that // e.g. /opt/bin/foo, /usr/bin/bar and /usr/bin/baz would give /usr and /opt - size_t topLevelLength = strlen(toplevel); + size_t topLevelLength = toplevel.length(); std::set<std::string> installDirs; for (std::vector<std::string>::const_iterator fileIt = files.begin(); fileIt != files.end(); ++ fileIt ) @@ -160,7 +158,7 @@ int cmCPackDebGenerator::CompressFiles(const char* outFileName, std::string output; int retVal = -1; int res = cmSystemTools::RunSingleCommand(cmd.c_str(), &output, - &retVal, toplevel, this->GeneratorVerbose, 0); + &retVal, toplevel.c_str(), this->GeneratorVerbose, 0); if ( !res || retVal ) { @@ -196,7 +194,7 @@ int cmCPackDebGenerator::CompressFiles(const char* outFileName, //std::string output; //int retVal = -1; res = cmSystemTools::RunSingleCommand(cmd.c_str(), &output, - &retVal, toplevel, this->GeneratorVerbose, 0); + &retVal, toplevel.c_str(), this->GeneratorVerbose, 0); // debian md5sums entries are like this: // 014f3604694729f3bf19263bac599765 usr/bin/ccmake // thus strip the full path (with the trailing slash) @@ -237,7 +235,7 @@ int cmCPackDebGenerator::CompressFiles(const char* outFileName, } } res = cmSystemTools::RunSingleCommand(cmd.c_str(), &output, - &retVal, toplevel, this->GeneratorVerbose, 0); + &retVal, toplevel.c_str(), this->GeneratorVerbose, 0); if ( !res || retVal ) { @@ -263,7 +261,7 @@ int cmCPackDebGenerator::CompressFiles(const char* outFileName, arFiles.push_back(topLevelString + "debian-binary"); arFiles.push_back(topLevelString + "control.tar.gz"); arFiles.push_back(topLevelString + "data.tar.gz"); - res = ar_append(outFileName, arFiles); + res = ar_append(packageFileNames[0].c_str(), arFiles); if ( res!=0 ) { std::string tmpFile = this->GetOption("CPACK_TOPLEVEL_DIRECTORY"); |