From af674d82d5cd36e22223ec49675d32adad07e0a9 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Thu, 15 Aug 2019 13:36:04 +0200 Subject: 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. --- apt-pkg/cachefilter-patterns.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'apt-pkg/cachefilter-patterns.h') 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; -- cgit v1.2.3