From 82f4cfc971ef6a2e56b34227d9e0b1a594dc2265 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 13 Feb 2024 12:33:51 +0100 Subject: Add the ?security pattern --- apt-pkg/cachefilter-patterns.cc | 2 ++ apt-pkg/cachefilter-patterns.h | 9 +++++++++ 2 files changed, 11 insertions(+) (limited to 'apt-pkg') diff --git a/apt-pkg/cachefilter-patterns.cc b/apt-pkg/cachefilter-patterns.cc index 6ef34c953..7e6d84ff6 100644 --- a/apt-pkg/cachefilter-patterns.cc +++ b/apt-pkg/cachefilter-patterns.cc @@ -502,6 +502,8 @@ std::unique_ptr PatternParser::aPattern(std::unique_p return std::make_unique(file); if (node->matches("?section", 1, 1)) return std::make_unique(aWord(node->arguments[0])); + if (node->matches("?security", 0, 0)) + return std::make_unique(); if (node->matches("?source-package", 1, 1)) return std::make_unique(aWord(node->arguments[0])); if (node->matches("?source-version", 1, 1)) diff --git a/apt-pkg/cachefilter-patterns.h b/apt-pkg/cachefilter-patterns.h index 5fc00377f..fa4605253 100644 --- a/apt-pkg/cachefilter-patterns.h +++ b/apt-pkg/cachefilter-patterns.h @@ -415,6 +415,15 @@ struct APT_HIDDEN VersionIsSection : public VersionAnyMatcher } }; +struct APT_HIDDEN VersionIsSecurity : public VersionAnyMatcher +{ + VersionIsSecurity() {} + bool operator()(pkgCache::VerIterator const &Ver) override + { + return Ver.IsSecurityUpdate(); + } +}; + struct APT_HIDDEN VersionIsSourcePackage : public VersionAnyMatcher { BaseRegexMatcher matcher; -- cgit v1.2.3-70-g09d2