diff options
| author | Julian Andres Klode <julian.klode@canonical.com> | 2023-01-13 12:23:43 +0100 |
|---|---|---|
| committer | Julian Andres Klode <julian.klode@canonical.com> | 2023-01-13 12:27:55 +0100 |
| commit | 73f7408f6d164e595fb2e3a3df856a8f8168fcb9 (patch) | |
| tree | b2efb1ed3df668e5faa478a4fc165d2af7be922b /apt-pkg | |
| parent | 5919d2d18eac6e445a59da23246df94258e103eb (diff) | |
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.
Diffstat (limited to 'apt-pkg')
| -rw-r--r-- | apt-pkg/cachefilter-patterns.h | 5 |
1 files changed, 5 insertions, 0 deletions
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 |
