From 391c9f20208584bf429c7717047a0637d0d670fb Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Wed, 21 Aug 2019 22:31:01 +0200 Subject: patterns: Add ?archive --- apt-pkg/cachefilter-patterns.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'apt-pkg/cachefilter-patterns.h') diff --git a/apt-pkg/cachefilter-patterns.h b/apt-pkg/cachefilter-patterns.h index 46a54cf81..c92a152d6 100644 --- a/apt-pkg/cachefilter-patterns.h +++ b/apt-pkg/cachefilter-patterns.h @@ -260,6 +260,21 @@ struct VersionAnyMatcher : public Matcher } }; +struct VersionIsArchive : public VersionAnyMatcher +{ + BaseRegexMatcher matcher; + VersionIsArchive(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().Archive() && matcher(VF.File().Archive())) + return true; + } + return false; + } +}; + struct VersionIsSourcePackage : public VersionAnyMatcher { BaseRegexMatcher matcher; -- cgit v1.2.3