summaryrefslogtreecommitdiff
path: root/apt-pkg/cachefilter-patterns.h
diff options
context:
space:
mode:
authorJulian Andres Klode <julian.klode@canonical.com>2019-08-21 22:21:30 +0200
committerJulian Andres Klode <julian.klode@canonical.com>2019-11-25 11:32:19 +0100
commit7fa292edbe924923cc689721fe58244ca0a40bcd (patch)
treefad811887e13057885056900431bdce9de62e487 /apt-pkg/cachefilter-patterns.h
parent8428114608627fe0a08dcf1589931f6db025f0b4 (diff)
patterns: Add ?source-name and ?source-version
Diffstat (limited to 'apt-pkg/cachefilter-patterns.h')
-rw-r--r--apt-pkg/cachefilter-patterns.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/apt-pkg/cachefilter-patterns.h b/apt-pkg/cachefilter-patterns.h
index 4959b0f14..46a54cf81 100644
--- a/apt-pkg/cachefilter-patterns.h
+++ b/apt-pkg/cachefilter-patterns.h
@@ -260,6 +260,26 @@ struct VersionAnyMatcher : public Matcher
}
};
+struct VersionIsSourcePackage : public VersionAnyMatcher
+{
+ BaseRegexMatcher matcher;
+ VersionIsSourcePackage(std::string const &pattern) : matcher(pattern) {}
+ bool operator()(pkgCache::VerIterator const &Ver) override
+ {
+ return matcher(Ver.SourcePkgName());
+ }
+};
+
+struct VersionIsSourceVersion : public VersionAnyMatcher
+{
+ BaseRegexMatcher matcher;
+ VersionIsSourceVersion(std::string const &pattern) : matcher(pattern) {}
+ bool operator()(pkgCache::VerIterator const &Ver) override
+ {
+ return matcher(Ver.SourceVerStr());
+ }
+};
+
struct VersionIsVersion : public VersionAnyMatcher
{
BaseRegexMatcher matcher;