diff options
author | Julian Andres Klode <julian.klode@canonical.com> | 2019-08-21 22:53:25 +0200 |
---|---|---|
committer | Julian Andres Klode <julian.klode@canonical.com> | 2019-11-25 11:32:19 +0100 |
commit | 02b0afd5098534eff34a8fa1d44454c7a3e1ff09 (patch) | |
tree | c352b5670fc18c6e97dbff53aa75538f923647d1 /apt-pkg/cachefilter-patterns.h | |
parent | 391c9f20208584bf429c7717047a0637d0d670fb (diff) |
patterns: Add ?origin
Diffstat (limited to 'apt-pkg/cachefilter-patterns.h')
-rw-r--r-- | apt-pkg/cachefilter-patterns.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/apt-pkg/cachefilter-patterns.h b/apt-pkg/cachefilter-patterns.h index c92a152d6..3d1735442 100644 --- a/apt-pkg/cachefilter-patterns.h +++ b/apt-pkg/cachefilter-patterns.h @@ -275,6 +275,21 @@ struct VersionIsArchive : public VersionAnyMatcher } }; +struct VersionIsOrigin : public VersionAnyMatcher +{ + BaseRegexMatcher matcher; + VersionIsOrigin(std::string const &pattern) : matcher(pattern) {} + bool operator()(pkgCache::VerIterator const &Ver) override + { + for (auto VF = Ver.FileList(); not VF.end(); VF++) + { + if (VF.File().Origin() && matcher(VF.File().Origin())) + return true; + } + return false; + } +}; + struct VersionIsSourcePackage : public VersionAnyMatcher { BaseRegexMatcher matcher; |