summaryrefslogtreecommitdiff
path: root/apt-pkg/cachefilter-patterns.h
diff options
context:
space:
mode:
authorJulian Andres Klode <julian.klode@canonical.com>2019-08-15 13:31:30 +0200
committerJulian Andres Klode <julian.klode@canonical.com>2019-08-15 20:21:34 +0200
commita3e9ab661b2d670f7d0da53a5f56c52af0763c5b (patch)
treebf064b629923e5d9598ea42114521376b8e3385b /apt-pkg/cachefilter-patterns.h
parent89790c11799c4144e37a6a1f0dbe0f6fff89ea89 (diff)
Add ?config-files and ?installed patterns
These two are mutually exclusive states of installed-ness. And ?installed package is fully unpacked and configured; a ?config-files package only has config files left.
Diffstat (limited to 'apt-pkg/cachefilter-patterns.h')
-rw-r--r--apt-pkg/cachefilter-patterns.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/apt-pkg/cachefilter-patterns.h b/apt-pkg/cachefilter-patterns.h
index 68ad32f9a..7770385c9 100644
--- a/apt-pkg/cachefilter-patterns.h
+++ b/apt-pkg/cachefilter-patterns.h
@@ -128,6 +128,14 @@ struct PackageIsAutomatic : public PackageMatcher
}
};
+struct PackageIsConfigFiles : public PackageMatcher
+{
+ bool operator()(pkgCache::PkgIterator const &Pkg) override
+ {
+ return Pkg->CurrentState == pkgCache::State::ConfigFiles;
+ }
+};
+
struct PackageIsGarbage : public PackageMatcher
{
pkgCacheFile *Cache;
@@ -139,6 +147,17 @@ struct PackageIsGarbage : public PackageMatcher
}
};
+struct PackageIsInstalled : public PackageMatcher
+{
+ pkgCacheFile *Cache;
+ explicit PackageIsInstalled(pkgCacheFile *Cache) : Cache(Cache) {}
+ bool operator()(pkgCache::PkgIterator const &Pkg) override
+ {
+ assert(Cache != nullptr);
+ return Pkg->CurrentVer != 0;
+ }
+};
+
struct PackageIsObsolete : public PackageMatcher
{
bool operator()(pkgCache::PkgIterator const &pkg) override