diff options
author | Eric NOULARD <eric.noulard@gmail.com> | 2010-11-15 19:54:19 (GMT) |
---|---|---|
committer | Eric NOULARD <eric.noulard@gmail.com> | 2010-11-15 19:54:19 (GMT) |
commit | 66e86b4770dcda3b5e79776c4cda6e60646189f1 (patch) | |
tree | 8c3ba93992572f2f5200a3a1c442acbbbcec36ff /Source/CPack/cmCPackRPMGenerator.cxx | |
parent | 2c84d169b36b1b8713517a8d8799b82dbf59725a (diff) | |
download | CMake-66e86b4770dcda3b5e79776c4cda6e60646189f1.zip CMake-66e86b4770dcda3b5e79776c4cda6e60646189f1.tar.gz CMake-66e86b4770dcda3b5e79776c4cda6e60646189f1.tar.bz2 |
CPack fix kwstyle breakage and make CPackRPM backward compatible
backward compatible= No componentized RPM unless requested
using CPACK_RPM_COMP0NENT_INSTALL
Diffstat (limited to 'Source/CPack/cmCPackRPMGenerator.cxx')
-rw-r--r-- | Source/CPack/cmCPackRPMGenerator.cxx | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/Source/CPack/cmCPackRPMGenerator.cxx b/Source/CPack/cmCPackRPMGenerator.cxx index a06b626..34e93d3 100644 --- a/Source/CPack/cmCPackRPMGenerator.cxx +++ b/Source/CPack/cmCPackRPMGenerator.cxx @@ -44,7 +44,7 @@ int cmCPackRPMGenerator::PackageFiles() << toplevel << std::endl); /* Are we in the component packaging case */ - if (!this->ComponentGroups.empty()) + if (SupportsComponentInstallation() & (!this->ComponentGroups.empty())) { /* Reset package file name list it will be populated during the * component packaging run*/ @@ -57,8 +57,12 @@ int cmCPackRPMGenerator::PackageFiles() compIt!=this->Components.end(); ++compIt ) { std::string localToplevel(initialTopLevel); - std::string packageFileName(cmSystemTools::GetParentDirectory(toplevel.c_str())); - std::string outputFileName(std::string(this->GetOption("CPACK_PACKAGE_FILE_NAME")) + std::string packageFileName( + cmSystemTools::GetParentDirectory(toplevel.c_str()) + ); + std::string outputFileName( + std::string(this->GetOption("CPACK_PACKAGE_FILE_NAME") + ) +"-"+compIt->first + this->GetOutputExtension()); localToplevel += "/"+ compIt->first; @@ -68,12 +72,14 @@ int cmCPackRPMGenerator::PackageFiles() /* replace proposed CPACK_OUTPUT_FILE_NAME */ this->SetOption("CPACK_OUTPUT_FILE_NAME",outputFileName.c_str()); /* replace the TEMPORARY package file name */ - this->SetOption("CPACK_TEMPORARY_PACKAGE_FILE_NAME",packageFileName.c_str()); + this->SetOption("CPACK_TEMPORARY_PACKAGE_FILE_NAME", + packageFileName.c_str()); this->SetOption("CPACK_RPM_PACKAGE_COMPONENT",compIt->first.c_str()); if (!this->ReadListFile("CPackRPM.cmake")) { - cmCPackLogger(cmCPackLog::LOG_ERROR, "Error while execution CPackRPM.cmake" << std::endl); + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Error while execution CPackRPM.cmake" << std::endl); retval = 0; } @@ -86,7 +92,8 @@ int cmCPackRPMGenerator::PackageFiles() { if (!this->ReadListFile("CPackRPM.cmake")) { - cmCPackLogger(cmCPackLog::LOG_ERROR, "Error while execution CPackRPM.cmake" << std::endl); + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Error while execution CPackRPM.cmake" << std::endl); retval = 0; } } @@ -99,4 +106,15 @@ int cmCPackRPMGenerator::PackageFiles() return retval; } +bool cmCPackRPMGenerator::SupportsComponentInstallation() const + { + if (IsSet("CPACK_RPM_COMPONENT_INSTALL")) + { + return true; + } + else + { + return false; + } + } |