summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorAlex Turbov <i.zaufi@gmail.com>2021-07-12 23:58:17 (GMT)
committerBrad King <brad.king@kitware.com>2021-07-13 12:36:12 (GMT)
commit593ff734b08779bc2ac3f7d5975c2d12dfa5614b (patch)
tree4756a3b25598370866512d6c5aea154675ca664d /Source
parentc8f298ae0808675ddd70341f7c83348bc092fb3f (diff)
downloadCMake-593ff734b08779bc2ac3f7d5975c2d12dfa5614b.zip
CMake-593ff734b08779bc2ac3f7d5975c2d12dfa5614b.tar.gz
CMake-593ff734b08779bc2ac3f7d5975c2d12dfa5614b.tar.bz2
CPack/DEB: dbgsym package not generated for non-component packaging
Fix: #19735
Diffstat (limited to 'Source')
-rw-r--r--Source/CPack/cmCPackDebGenerator.cxx81
-rw-r--r--Source/CPack/cmCPackDebGenerator.h1
2 files changed, 37 insertions, 45 deletions
diff --git a/Source/CPack/cmCPackDebGenerator.cxx b/Source/CPack/cmCPackDebGenerator.cxx
index 70670af..cbdcf49 100644
--- a/Source/CPack/cmCPackDebGenerator.cxx
+++ b/Source/CPack/cmCPackDebGenerator.cxx
@@ -528,37 +528,7 @@ int cmCPackDebGenerator::PackageOnePack(std::string const& initialTopLevel,
return 0;
}
- try {
- this->packageFiles = findFilesIn(this->GetOption("GEN_WDIR"));
- } catch (const std::runtime_error& ex) {
- cmCPackLogger(cmCPackLog::LOG_ERROR, ex.what() << std::endl);
- return 0;
- }
-
- bool retval = this->createDeb();
- // add the generated package to package file names list
- packageFileName = cmStrCat(this->GetOption("CPACK_TOPLEVEL_DIRECTORY"), '/',
- this->GetOption("GEN_CPACK_OUTPUT_FILE_NAME"));
- this->packageFileNames.emplace_back(std::move(packageFileName));
-
- if (this->IsOn("GEN_CPACK_DEBIAN_DEBUGINFO_PACKAGE") &&
- this->GetOption("GEN_DBGSYMDIR")) {
- try {
- this->packageFiles = findFilesIn(this->GetOption("GEN_DBGSYMDIR"));
- } catch (const std::runtime_error& ex) {
- cmCPackLogger(cmCPackLog::LOG_ERROR, ex.what() << std::endl);
- return 0;
- }
-
- retval = this->createDbgsymDDeb() || retval;
- // add the generated package to package file names list
- packageFileName =
- cmStrCat(this->GetOption("CPACK_TOPLEVEL_DIRECTORY"), '/',
- this->GetOption("GEN_CPACK_DBGSYM_OUTPUT_FILE_NAME"));
- this->packageFileNames.emplace_back(std::move(packageFileName));
- }
-
- return int(retval);
+ return this->createDebPackages();
}
int cmCPackDebGenerator::PackageComponents(bool ignoreGroup)
@@ -652,19 +622,7 @@ int cmCPackDebGenerator::PackageComponentsAllInOne(
return 0;
}
- try {
- this->packageFiles = findFilesIn(this->GetOption("GEN_WDIR"));
- } catch (const std::runtime_error& ex) {
- cmCPackLogger(cmCPackLog::LOG_ERROR, ex.what() << std::endl);
- return 0;
- }
-
- bool retval = this->createDeb();
- // add the generated package to package file names list
- packageFileName = cmStrCat(this->GetOption("CPACK_TOPLEVEL_DIRECTORY"), '/',
- this->GetOption("GEN_CPACK_OUTPUT_FILE_NAME"));
- this->packageFileNames.emplace_back(std::move(packageFileName));
- return int(retval);
+ return this->createDebPackages();
}
int cmCPackDebGenerator::PackageFiles()
@@ -688,6 +646,40 @@ int cmCPackDebGenerator::PackageFiles()
return this->PackageComponentsAllInOne("");
}
+bool cmCPackDebGenerator::createDebPackages()
+{
+ try {
+ this->packageFiles = findFilesIn(this->GetOption("GEN_WDIR"));
+ } catch (const std::runtime_error& ex) {
+ cmCPackLogger(cmCPackLog::LOG_ERROR, ex.what() << std::endl);
+ return 0;
+ }
+
+ bool retval = this->createDeb();
+ // add the generated package to package file names list
+ this->packageFileNames.emplace_back(
+ cmStrCat(this->GetOption("CPACK_TOPLEVEL_DIRECTORY"), '/',
+ this->GetOption("GEN_CPACK_OUTPUT_FILE_NAME")));
+
+ if (this->IsOn("GEN_CPACK_DEBIAN_DEBUGINFO_PACKAGE") &&
+ this->GetOption("GEN_DBGSYMDIR")) {
+ try {
+ this->packageFiles = findFilesIn(this->GetOption("GEN_DBGSYMDIR"));
+ } catch (const std::runtime_error& ex) {
+ cmCPackLogger(cmCPackLog::LOG_ERROR, ex.what() << std::endl);
+ return 0;
+ }
+
+ retval = this->createDbgsymDDeb() || retval;
+ // add the generated package to package file names list
+ this->packageFileNames.emplace_back(
+ cmStrCat(this->GetOption("CPACK_TOPLEVEL_DIRECTORY"), '/',
+ this->GetOption("GEN_CPACK_DBGSYM_OUTPUT_FILE_NAME")));
+ }
+
+ return int(retval);
+}
+
bool cmCPackDebGenerator::createDeb()
{
std::map<std::string, std::string> controlValues;
@@ -855,7 +847,6 @@ bool cmCPackDebGenerator::createDbgsymDDeb()
DebGenerator gen(
this->Logger, this->GetOption("GEN_CPACK_DBGSYM_OUTPUT_FILE_NAME"),
this->GetOption("GEN_DBGSYMDIR"),
-
this->GetOption("CPACK_TOPLEVEL_DIRECTORY"),
this->GetOption("CPACK_TEMPORARY_DIRECTORY"),
this->GetOption("GEN_CPACK_DEBIAN_COMPRESSION_TYPE"),
diff --git a/Source/CPack/cmCPackDebGenerator.h b/Source/CPack/cmCPackDebGenerator.h
index 502746c..61a6616 100644
--- a/Source/CPack/cmCPackDebGenerator.h
+++ b/Source/CPack/cmCPackDebGenerator.h
@@ -63,6 +63,7 @@ protected:
const std::string& componentName) override;
private:
+ bool createDebPackages();
bool createDeb();
bool createDbgsymDDeb();