CPack/DEB: dbgsym package not generated for non-component packaging

Fix: #19735
This commit is contained in:
Alex Turbov
2021-07-13 02:58:17 +03:00
committed by Brad King
parent c8f298ae08
commit 593ff734b0
5 changed files with 82 additions and 71 deletions
+36 -45
View File
@@ -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"),
+1
View File
@@ -63,6 +63,7 @@ protected:
const std::string& componentName) override;
private:
bool createDebPackages();
bool createDeb();
bool createDbgsymDDeb();