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. --- apt-pkg/cachefilter-patterns.cc | 2 ++ apt-pkg/cachefilter-patterns.h | 10 ++++++++++ 2 files changed, 12 insertions(+) (limited to 'apt-pkg') diff --git a/apt-pkg/cachefilter-patterns.cc b/apt-pkg/cachefilter-patterns.cc index faf5735b8..6ef34c953 100644 --- a/apt-pkg/cachefilter-patterns.cc +++ b/apt-pkg/cachefilter-patterns.cc @@ -498,6 +498,8 @@ std::unique_ptr PatternParser::aPattern(std::unique_p return std::make_unique(); if (node->matches("?origin", 1, 1)) return std::make_unique(aWord(node->arguments[0])); + if (node->matches("?phasing", 0, 0)) + return std::make_unique(file); if (node->matches("?section", 1, 1)) return std::make_unique(aWord(node->arguments[0])); if (node->matches("?source-package", 1, 1)) diff --git a/apt-pkg/cachefilter-patterns.h b/apt-pkg/cachefilter-patterns.h index 2d48a1cc9..5fc00377f 100644 --- a/apt-pkg/cachefilter-patterns.h +++ b/apt-pkg/cachefilter-patterns.h @@ -243,6 +243,16 @@ struct APT_HIDDEN PackageIsObsolete : public PackageMatcher } }; +struct APT_HIDDEN PackageIsPhasing : public PackageMatcher +{ + pkgCacheFile *Cache; + explicit PackageIsPhasing(pkgCacheFile *Cache) : Cache(Cache) {} + bool operator()(pkgCache::PkgIterator const &pkg) override + { + return (*Cache)->PhasingApplied(pkg); + } +}; + struct APT_HIDDEN PackageIsUpgradable : public PackageMatcher { pkgCacheFile *Cache; -- cgit v1.2.3-70-g09d2