diff options
| author | Johannes Schauer Marin Rodrigues <josch@mister-muffin.de> | 2021-12-26 16:29:59 +0100 |
|---|---|---|
| committer | Johannes Schauer Marin Rodrigues <josch@mister-muffin.de> | 2021-12-26 22:04:21 +0100 |
| commit | ed282548bc4b8f96ac531c9f73b42d968eadea98 (patch) | |
| tree | 136608db9a6f62b13cb39f0ad872e9e56cbfe985 /apt-pkg/cachefilter-patterns.h | |
| parent | 2662f6f255a2f1fee25632dc7666d4153bf5248c (diff) | |
add pattern to select packages by codename (closes: #1002646)
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 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; |
