mirror of
https://git.launchpad.net/~ubuntu-qt-code/+git/calamares-settings-ubuntu
synced 2025-05-05 15:41:30 +00:00
[pkgselectprocess] Do not include uninstallable virtual packages in the CPBE output
When we are creating the final list of packages to feed to "apt install," virtual packages which do not have a valid candidate are included in this list, causing the installation to fail. When creating this list, use FindGrp instead of FindPkg, and only add it to the list if there is a valid candidate. Additionally, add these items to an unordered set, to eliminate deduplication (LP: #2106773). A reliable testcase for this is the libreoffice-help-is package, at least in Plucky.
This commit is contained in:
parent
dc3e8a738f
commit
197d24e295
@ -1,5 +1,6 @@
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <unordered_set>
|
||||
#include <apt-pkg/algorithms.h>
|
||||
#include <apt-pkg/cacheiterators.h>
|
||||
#include <apt-pkg/init.h>
|
||||
@ -28,9 +29,17 @@ int main(int argc, char* argv[]) {
|
||||
std::vector<std::string> package_names(argv + 1, argv + argc);
|
||||
if (package_names.empty()) return 0;
|
||||
|
||||
std::unordered_set<std::string> seen_packages;
|
||||
for (std::string package_name : package_names) {
|
||||
pkgCache::PkgIterator it = cache->GetPkgCache()->FindPkg(package_name);
|
||||
if (!it.end()) std::cout << package_name << " ";
|
||||
if (seen_packages.contains(package_name)) continue;
|
||||
seen_packages.insert(package_name);
|
||||
pkgCache::GrpIterator grp = cache->GetPkgCache()->FindGrp(package_name);
|
||||
if (!grp.end()) {
|
||||
pkgCache::PkgIterator it = grp.FindPreferredPkg(true);
|
||||
if (!it.end() && !it.VersionList().end()) {
|
||||
std::cout << package_name << " ";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::cout << "\n";
|
||||
|
11
debian/changelog
vendored
11
debian/changelog
vendored
@ -1,3 +1,14 @@
|
||||
calamares-settings-ubuntu (1:25.04.25) UNRELEASED; urgency=medium
|
||||
|
||||
* [pkgselectprocess] When we are creating the final list of packages to feed
|
||||
to "apt install," virtual packages which do not have a valid candidate are
|
||||
included in this list, causing the installation to fail. When creating
|
||||
this list, use FindGrp instead of FindPkg, and only add it to the list if
|
||||
there is a valid candidate. Additionally, add these items to an unordered
|
||||
set, to eliminate deduplication (LP: #2106773).
|
||||
|
||||
-- Simon Quigley <tsimonq2@ubuntu.com> Sat, 12 Apr 2025 00:23:39 -0500
|
||||
|
||||
calamares-settings-ubuntu (1:25.04.24) plucky; urgency=medium
|
||||
|
||||
* Bump Standards-Version to 4.7.2, no changes needed.
|
||||
|
Loading…
x
Reference in New Issue
Block a user