From 422e68f569f374f697b84332f7e68c6fe5f7389f Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 13 Feb 2024 12:29:28 +0100 Subject: Add a new ?phasing pattern This selects all packages that are being kept back due to phasing on your system. --- doc/apt-patterns.7.xml | 3 +++ 1 file changed, 3 insertions(+) (limited to 'doc/apt-patterns.7.xml') diff --git a/doc/apt-patterns.7.xml b/doc/apt-patterns.7.xml index 6b3f91e96..e69854e6d 100644 --- a/doc/apt-patterns.7.xml +++ b/doc/apt-patterns.7.xml @@ -116,6 +116,9 @@ ?obsolete~o Selects packages that no longer exist in repositories. + ?phasing + Selects packages that will be kept back in upgrades due to phasing. + ?upgradable~U Selects packages that can be upgraded (have a newer candidate). -- cgit v1.2.3-70-g09d2 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 +++++++++ doc/apt-patterns.7.xml | 3 +++ test/integration/test-phased-updates-upgrade | 4 ++++ 4 files changed, 18 insertions(+) (limited to 'doc/apt-patterns.7.xml') 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; diff --git a/doc/apt-patterns.7.xml b/doc/apt-patterns.7.xml index e69854e6d..e87fef23d 100644 --- a/doc/apt-patterns.7.xml +++ b/doc/apt-patterns.7.xml @@ -162,6 +162,9 @@ ?priority(NAME)~pNAME Selects versions where the Priority string equals the given name. + ?security + Selects packages that are a security update or succeed a security update. + diff --git a/test/integration/test-phased-updates-upgrade b/test/integration/test-phased-updates-upgrade index 518e39fed..3bee1dc86 100755 --- a/test/integration/test-phased-updates-upgrade +++ b/test/integration/test-phased-updates-upgrade @@ -72,6 +72,10 @@ phased-dep/unstable-updates 3 all [upgradable from: 1] phased-depends-ready-dep/unstable-updates 3 all [upgradable from: 1] phased/unstable-updates 3 all [upgradable from: 1]" apt list '?phasing' +testsuccessequal "Listing... +phased-security-same/unstable-security,unstable-updates 3 all [upgradable from: 1] +phased-security/unstable-updates 3 all [upgradable from: 1]" apt list '?security' + for always in APT::Get::Always-Include-Phased-Updates Update-Manager::Always-Include-Phased-Updates; do testsuccessequal "Reading package lists... Building dependency tree... -- cgit v1.2.3-70-g09d2