diff -Nru packagekit-1.2.5/debian/changelog packagekit-1.2.5/debian/changelog --- packagekit-1.2.5/debian/changelog 2022-02-21 01:40:12.000000000 -0800 +++ packagekit-1.2.5/debian/changelog 2022-02-22 15:06:08.000000000 -0800 @@ -1,3 +1,9 @@ +packagekit (1.2.5-1ubuntu2~ppa1) jammy; urgency=medium + + * PATCH: Fix emission of package IDs (LP: #1961837) + + -- Erich Eickmeyer Tue, 22 Feb 2022 15:06:08 -0800 + packagekit (1.2.5-1ubuntu1) jammy; urgency=low * Merge from Debian unstable. Remaining changes: diff -Nru packagekit-1.2.5/debian/patches/0001_fix-emission-of-package-ids.patch packagekit-1.2.5/debian/patches/0001_fix-emission-of-package-ids.patch --- packagekit-1.2.5/debian/patches/0001_fix-emission-of-package-ids.patch 1969-12-31 16:00:00.000000000 -0800 +++ packagekit-1.2.5/debian/patches/0001_fix-emission-of-package-ids.patch 2022-02-22 15:03:51.000000000 -0800 @@ -0,0 +1,42 @@ +From f1b905cf2d0c6ebbad2c7ed12e24b19268fbef63 Mon Sep 17 00:00:00 2001 +From: Matthias Klumpp +Date: Tue, 22 Feb 2022 23:35:02 +0100 +Subject: [PATCH] aptcc: Fix emission of package IDs if there is just one + candidate available + +The previous loop was not emitting the resolved package ID if the +candidate list was already at its end, even if there was a package +available. +The new loop will emit a package in all (sensible) cases. + +Resolves: #534 +--- + backends/aptcc/apt-cache-file.cpp | 13 ++++++++----- + 1 file changed, 8 insertions(+), 5 deletions(-) + +diff --git a/backends/aptcc/apt-cache-file.cpp b/backends/aptcc/apt-cache-file.cpp +index c5bbc07c5..03ea03113 100644 +--- a/backends/aptcc/apt-cache-file.cpp ++++ b/backends/aptcc/apt-cache-file.cpp +@@ -380,13 +380,16 @@ PkgInfo AptCacheFile::resolvePkgID(const gchar *packageId) + strcmp(ver.VerStr(), parts[PK_PACKAGE_ID_VERSION]) == 0) + return PkgInfo(ver, piAction); + +- const pkgCache::VerIterator &candidateVer = findCandidateVer(pkg); + // check to see if the provided package isn't virtual too + // also iterate through all the available versions +- for (auto candidate = candidateVer; !candidate.end(); candidate++) { +- if (strcmp(candidate.VerStr(), parts[PK_PACKAGE_ID_VERSION]) == 0) { +- return PkgInfo(ver, piAction); +- } ++ auto candidateVer = findCandidateVer(pkg); ++ while (true) { ++ if (strcmp(candidateVer.VerStr(), parts[PK_PACKAGE_ID_VERSION]) == 0) ++ return PkgInfo(candidateVer, piAction); ++ ++ if (candidateVer.end()) ++ break; ++ candidateVer++; + } + + return PkgInfo(ver, piAction); diff -Nru packagekit-1.2.5/debian/patches/series packagekit-1.2.5/debian/patches/series --- packagekit-1.2.5/debian/patches/series 2022-02-17 19:15:49.000000000 -0800 +++ packagekit-1.2.5/debian/patches/series 2022-02-22 15:04:58.000000000 -0800 @@ -1 +1,2 @@ policy.diff +0001_fix-emission-of-package-ids.patch