diff options
author | Andy Cedilnik <andy.cedilnik@kitware.com> | 2006-01-02 21:14:21 (GMT) |
---|---|---|
committer | Andy Cedilnik <andy.cedilnik@kitware.com> | 2006-01-02 21:14:21 (GMT) |
commit | bbf1c2d275ce58a76cfe5d3a6539a3bb490456b7 (patch) | |
tree | 73ebeba061fde907454361a8d51e7f9ddadbaa81 /Source/CPack/cmCPackTGZGenerator.cxx | |
parent | 9d0f86d7d017aa00420800bd72e00d45681710c9 (diff) | |
download | CMake-bbf1c2d275ce58a76cfe5d3a6539a3bb490456b7.zip CMake-bbf1c2d275ce58a76cfe5d3a6539a3bb490456b7.tar.gz CMake-bbf1c2d275ce58a76cfe5d3a6539a3bb490456b7.tar.bz2 |
ENH: More improvements and add logging
Diffstat (limited to 'Source/CPack/cmCPackTGZGenerator.cxx')
-rw-r--r-- | Source/CPack/cmCPackTGZGenerator.cxx | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/Source/CPack/cmCPackTGZGenerator.cxx b/Source/CPack/cmCPackTGZGenerator.cxx index baa612d..d7ffd9a 100644 --- a/Source/CPack/cmCPackTGZGenerator.cxx +++ b/Source/CPack/cmCPackTGZGenerator.cxx @@ -23,6 +23,7 @@ #include "cmSystemTools.h" #include "cmMakefile.h" #include "cmGeneratedFileStream.h" +#include "cmCPackLog.h" #include <cmsys/SystemTools.hxx> #include <cmzlib/zlib.h> @@ -74,6 +75,7 @@ public: cmCPackTGZGenerator* Generator; }; +//---------------------------------------------------------------------- extern "C" { int cmCPackTGZ_Data_Open(void *client_data, const char* name, int oflags, mode_t mode); ssize_t cmCPackTGZ_Data_Write(void *client_data, void *buff, size_t n); @@ -96,7 +98,7 @@ int cmCPackTGZ_Data_Open(void *client_data, const char* pathname, int, mode_t) gf->SetCompression(true); gf->SetCompressionExtraExtension(false); - if ( !cmCPackTGZGeneratorForward::GenerateHeader(mydata->Generator,mydata->OutputStream)) + if ( !cmCPackTGZGeneratorForward::GenerateHeader(mydata->Generator,gf)) { return -1; } @@ -130,7 +132,7 @@ int cmCPackTGZ_Data_Close(void *client_data) int cmCPackTGZGenerator::CompressFiles(const char* outFileName, const char* toplevel, const std::vector<std::string>& files) { - std::cout << "Toplevel: " << toplevel << std::endl; + cmCPackLogger(cmCPackLog::LOG_DEBUG, "Toplevel: " << toplevel << std::endl); cmCPackTGZ_Data mydata(this); TAR *t; char buf[TAR_MAXPATHLEN]; @@ -155,7 +157,7 @@ int cmCPackTGZGenerator::CompressFiles(const char* outFileName, const char* topl (m_GeneratorVerbose?TAR_VERBOSE:0) | 0) == -1) { - cmSystemTools::Error("Problem with tar_open(): ", strerror(errno)); + cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem with tar_open(): " << strerror(errno) << std::endl); return 0; } @@ -168,24 +170,23 @@ int cmCPackTGZGenerator::CompressFiles(const char* outFileName, const char* topl buf[sizeof(buf)-1] = 0; if (tar_append_tree(t, buf, pathname) != 0) { - cmOStringStream ostr; - ostr << "Problem with tar_append_tree(\"" << buf << "\", \"" << pathname << "\"): " - << strerror(errno); - cmSystemTools::Error(ostr.str().c_str()); + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Problem with tar_append_tree(\"" << buf << "\", \"" << pathname << "\"): " + << strerror(errno) << std::endl); tar_close(t); return 0; } } if (tar_append_eof(t) != 0) { - cmSystemTools::Error("Problem with tar_append_eof(): ", strerror(errno)); + cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem with tar_append_eof(): " << strerror(errno) << std::endl); tar_close(t); return 0; } if (tar_close(t) != 0) { - cmSystemTools::Error("Problem with tar_close(): ", strerror(errno)); + cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem with tar_close(): " << strerror(errno) << std::endl); return 0; } return 1; |