From 73f7408f6d164e595fb2e3a3df856a8f8168fcb9 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Fri, 13 Jan 2023 12:23:43 +0100 Subject: make ?installed pattern match installed version only when narrowed This is the correct behavior, but it was overlooked when aptitude patterns where ported. I remember wondering about this, but I checked the aptitude code and saw a check that CurrentVer != 0 or something and then apparently did not notice another implementation for version matching. --- apt-pkg/cachefilter-patterns.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'apt-pkg/cachefilter-patterns.h') diff --git a/apt-pkg/cachefilter-patterns.h b/apt-pkg/cachefilter-patterns.h index 284fcc1cf..2d48a1cc9 100644 --- a/apt-pkg/cachefilter-patterns.h +++ b/apt-pkg/cachefilter-patterns.h @@ -212,6 +212,11 @@ struct APT_HIDDEN PackageIsInstalled : public PackageMatcher assert(Cache != nullptr); return Pkg->CurrentVer != 0; } + bool operator()(pkgCache::VerIterator const &Ver) override + { + assert(Cache != nullptr); + return Ver == Ver.ParentPkg().CurrentVer(); + } }; struct APT_HIDDEN PackageIsObsolete : public PackageMatcher -- cgit v1.2.3-70-g09d2