diff options
| author | Julian Andres Klode <jak@debian.org> | 2021-12-26 21:36:41 +0000 |
|---|---|---|
| committer | Julian Andres Klode <jak@debian.org> | 2021-12-26 21:36:41 +0000 |
| commit | c6bd75f906c9c782e739ec99f2983407500811bf (patch) | |
| tree | 136608db9a6f62b13cb39f0ad872e9e56cbfe985 /apt-pkg/cachefilter-patterns.h | |
| parent | 2662f6f255a2f1fee25632dc7666d4153bf5248c (diff) | |
| parent | ed282548bc4b8f96ac531c9f73b42d968eadea98 (diff) | |
Merge branch 'bug-1002646' into 'main'
add pattern to select packages by codename (closes: #1002646)
See merge request apt-team/apt!205
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; |
