summaryrefslogtreecommitdiff
path: root/apt-pkg/cachefilter-patterns.h
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg/cachefilter-patterns.h')
-rw-r--r--apt-pkg/cachefilter-patterns.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/apt-pkg/cachefilter-patterns.h b/apt-pkg/cachefilter-patterns.h
index 7770385c9..c219e5bcd 100644
--- a/apt-pkg/cachefilter-patterns.h
+++ b/apt-pkg/cachefilter-patterns.h
@@ -128,6 +128,18 @@ struct PackageIsAutomatic : public PackageMatcher
}
};
+struct PackageIsBroken : public PackageMatcher
+{
+ pkgCacheFile *Cache;
+ explicit PackageIsBroken(pkgCacheFile *Cache) : Cache(Cache) {}
+ bool operator()(pkgCache::PkgIterator const &Pkg) override
+ {
+ assert(Cache != nullptr);
+ auto state = (*Cache)[Pkg];
+ return state.InstBroken() || state.NowBroken();
+ }
+};
+
struct PackageIsConfigFiles : public PackageMatcher
{
bool operator()(pkgCache::PkgIterator const &Pkg) override