summaryrefslogtreecommitdiff
path: root/apt-pkg/cachefilter-patterns.h
diff options
context:
space:
mode:
authorJulian Andres Klode <julian.klode@canonical.com>2019-08-15 13:36:04 +0200
committerJulian Andres Klode <julian.klode@canonical.com>2019-08-15 20:21:34 +0200
commitaf674d82d5cd36e22223ec49675d32adad07e0a9 (patch)
treeec87d76fccf193bc56756e56b0275d2701685f09 /apt-pkg/cachefilter-patterns.h
parent08762e0e4e2923360339eeb4d8ed26a00d7f1de5 (diff)
Add the ?exact-name pattern
The ?exact-name pattern matches the name exactly, there is no substring matching going on, or any regular expression or fnmatch magic.
Diffstat (limited to 'apt-pkg/cachefilter-patterns.h')
-rw-r--r--apt-pkg/cachefilter-patterns.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/apt-pkg/cachefilter-patterns.h b/apt-pkg/cachefilter-patterns.h
index 17f1fc752..993839425 100644
--- a/apt-pkg/cachefilter-patterns.h
+++ b/apt-pkg/cachefilter-patterns.h
@@ -166,6 +166,16 @@ struct PackageIsEssential : public PackageMatcher
}
};
+struct PackageHasExactName : public PackageMatcher
+{
+ std::string name;
+ explicit PackageHasExactName(std::string name) : name(name) {}
+ bool operator()(pkgCache::PkgIterator const &Pkg) override
+ {
+ return Pkg.Name() == name;
+ }
+};
+
struct PackageIsInstalled : public PackageMatcher
{
pkgCacheFile *Cache;