From ed282548bc4b8f96ac531c9f73b42d968eadea98 Mon Sep 17 00:00:00 2001 From: Johannes Schauer Marin Rodrigues Date: Sun, 26 Dec 2021 16:29:59 +0100 Subject: add pattern to select packages by codename (closes: #1002646) --- 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 d55cb6335..e6ea16c68 100644 --- a/apt-pkg/cachefilter-patterns.h +++ b/apt-pkg/cachefilter-patterns.h @@ -363,6 +363,21 @@ struct APT_HIDDEN VersionIsArchive : public VersionAnyMatcher } }; +struct APT_HIDDEN VersionIsCodename : public VersionAnyMatcher +{ + BaseRegexMatcher matcher; + VersionIsCodename(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().Codename() && matcher(VF.File().Codename())) + return true; + } + return false; + } +}; + struct APT_HIDDEN VersionIsOrigin : public VersionAnyMatcher { BaseRegexMatcher matcher; -- cgit v1.2.3-70-g09d2