diff options
author | Brad King <brad.king@kitware.com> | 2010-08-17 15:12:42 -0400 |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2010-08-17 15:12:42 -0400 |
commit | cc2ba7f9c283a28804967820fa8f212f630d6aa8 (patch) | |
tree | eecd5a7f37f78214f9fb443ff5d05532a96fb2ab /Source/CPack/cmCPackArchiveGenerator.cxx | |
parent | 57c5bf5b18029ae1e6e28a39c15c51ceb02155a4 (diff) | |
parent | bd510fe4ea43ed6adfb28dc830db4489b59ef2aa (diff) | |
download | cmake-cc2ba7f9c283a28804967820fa8f212f630d6aa8.tar.gz |
Merge topic 'CPack-APIredesign'
bd510fe CPack: Avoid member shadowing after API refactor (part2)
31a313d CPack: Avoid member shadowing after API refactor
cd7b8a0 CPack: Refactor API in order to handle multi-file packages
Diffstat (limited to 'Source/CPack/cmCPackArchiveGenerator.cxx')
-rw-r--r-- | Source/CPack/cmCPackArchiveGenerator.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Source/CPack/cmCPackArchiveGenerator.cxx b/Source/CPack/cmCPackArchiveGenerator.cxx index 5981603ed8..8799330ca4 100644 --- a/Source/CPack/cmCPackArchiveGenerator.cxx +++ b/Source/CPack/cmCPackArchiveGenerator.cxx @@ -164,8 +164,7 @@ int cmCPackArchiveGenerator::InitializeInternal() return this->Superclass::InitializeInternal(); } -int cmCPackArchiveGenerator::CompressFiles(const char* outFileName, - const char* toplevel, const std::vector<std::string>& files) +int cmCPackArchiveGenerator::PackageFiles() { int res = ARCHIVE_OK; #define CHECK_ARCHIVE_ERROR(res, msg) \ @@ -178,14 +177,15 @@ int cmCPackArchiveGenerator::CompressFiles(const char* outFileName, << "\n"); \ } cmCPackLogger(cmCPackLog::LOG_DEBUG, "Toplevel: " - << (toplevel ? toplevel : "(NULL)") << std::endl); + << toplevel << std::endl); + // create a new archive struct archive* a = archive_write_new(); // Set the compress and archive types for the archive SetArchiveType(a, this->Compress, this->Archive); // Open binary stream cmGeneratedFileStream* gf = new cmGeneratedFileStream; - gf->Open(outFileName, false, true); + gf->Open(packageFileNames[0].c_str(), false, true); StreamData data(gf, this); // pass callbacks to archive_write_open to handle stream res = archive_write_open(a, @@ -202,13 +202,13 @@ int cmCPackArchiveGenerator::CompressFiles(const char* outFileName, CHECK_ARCHIVE_ERROR(res, "archive_read_disk_set_standard_lookup:"); std::vector<std::string>::const_iterator fileIt; std::string dir = cmSystemTools::GetCurrentWorkingDirectory(); - cmSystemTools::ChangeDirectory(toplevel); + cmSystemTools::ChangeDirectory(toplevel.c_str()); for ( fileIt = files.begin(); fileIt != files.end(); ++ fileIt ) { // create a new entry for each file struct archive_entry *entry = archive_entry_new(); // Get the relative path to the file - std::string rp = cmSystemTools::RelativePath(toplevel, fileIt->c_str()); + std::string rp = cmSystemTools::RelativePath(toplevel.c_str(), fileIt->c_str()); // Set the name of the entry to the file name archive_entry_set_pathname(entry, rp.c_str()); res = archive_read_disk_entry_from_file(disk, entry, -1, 0); |