diff options
author | Alexander Neundorf <neundorf@kde.org> | 2007-08-03 19:26:30 (GMT) |
---|---|---|
committer | Alexander Neundorf <neundorf@kde.org> | 2007-08-03 19:26:30 (GMT) |
commit | 68674bd0d795b1d560e8b819251480a753ba9882 (patch) | |
tree | db448fae4ab974786009ff09a6fea7c052b0137b /Source/CPack | |
parent | bf0c200f0a8f494f3e78465ab8be0763ecdcbb6d (diff) | |
download | CMake-68674bd0d795b1d560e8b819251480a753ba9882.zip CMake-68674bd0d795b1d560e8b819251480a753ba9882.tar.gz CMake-68674bd0d795b1d560e8b819251480a753ba9882.tar.bz2 |
ENH: better error messages from the debian package generator
-don't display the cpack help if a generator failed with some problem
-check for cmSystemTools::GetErrorOccuredFlag()
Alex
Diffstat (limited to 'Source/CPack')
-rw-r--r-- | Source/CPack/cmCPackGenericGenerator.cxx | 10 | ||||
-rw-r--r-- | Source/CPack/cpack.cxx | 6 |
2 files changed, 11 insertions, 5 deletions
diff --git a/Source/CPack/cmCPackGenericGenerator.cxx b/Source/CPack/cmCPackGenericGenerator.cxx index 64b283c..1987a4d 100644 --- a/Source/CPack/cmCPackGenericGenerator.cxx +++ b/Source/CPack/cmCPackGenericGenerator.cxx @@ -653,7 +653,7 @@ int cmCPackGenericGenerator::ProcessGenerator() tempDirectory = this->GetOption("CPACK_TOPLEVEL_DIRECTORY"); } if ( !this->CompressFiles(tempPackageFileName, - tempDirectory, gl.GetFiles()) ) + tempDirectory, gl.GetFiles()) || cmSystemTools::GetErrorOccuredFlag()) { cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem compressing the directory" << std::endl); @@ -695,7 +695,13 @@ int cmCPackGenericGenerator::Initialize(const char* name, cmMakefile* mf, "Cannot initialize the generator" << std::endl); return 0; } - return this->InitializeInternal(); + int result = this->InitializeInternal(); + if (cmSystemTools::GetErrorOccuredFlag()) + { + return 0; + } + + return result; } //---------------------------------------------------------------------- diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx index 67b9a05..ba9820f 100644 --- a/Source/CPack/cpack.cxx +++ b/Source/CPack/cpack.cxx @@ -377,13 +377,13 @@ int main (int argc, char *argv[]) { cmCPack_Log(&log, cmCPackLog::LOG_ERROR, "Cannot initialize CPack generator: " - << generator.c_str() << std::endl); + << gen << std::endl); parsed = 0; } if ( parsed && !cpackGenerator->Initialize(gen, mf, argv[0]) ) { cmCPack_Log(&log, cmCPackLog::LOG_ERROR, - "Cannot initialize the generator" << std::endl); + "Cannot initialize the generator " << gen << std::endl); parsed = 0; } @@ -442,7 +442,7 @@ int main (int argc, char *argv[]) } } - if ( !parsed || help ) + if ( help ) { doc.CheckOptions(argc, argv); // Construct and print requested documentation. |