summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
authorJulian Andres Klode <julian.klode@canonical.com>2019-11-26 11:45:44 +0100
committerJulian Andres Klode <julian.klode@canonical.com>2019-11-26 11:46:06 +0100
commit94b185bb738e063bcc387e31b39dcd041f283766 (patch)
treea1d7b4120c1bedfb1b153b1d37c85b9c878392af /apt-pkg
parent6801e6d2c63d4ff087024fc84a0feb8aef86886b (diff)
patterns: Implement ?narrow(...), as ?any-version(?and(...))
This is pure syntactic sugar - ?narrow does not exist in the abstract syntax.
Diffstat (limited to 'apt-pkg')
-rw-r--r--apt-pkg/cachefilter-patterns.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/apt-pkg/cachefilter-patterns.cc b/apt-pkg/cachefilter-patterns.cc
index 8b8695f71..f202df796 100644
--- a/apt-pkg/cachefilter-patterns.cc
+++ b/apt-pkg/cachefilter-patterns.cc
@@ -258,11 +258,13 @@ std::unique_ptr<APT::CacheFilter::Matcher> PatternParser::aPattern(std::unique_p
return std::make_unique<APT::CacheFilter::PackageNameMatchesFnmatch>(aWord(node->arguments[0]));
// Variable argument patterns
- if (node->matches("?and", 0, -1))
+ if (node->matches("?and", 0, -1) || node->matches("?narrow", 0, -1))
{
auto pattern = std::make_unique<APT::CacheFilter::ANDMatcher>();
for (auto &arg : node->arguments)
pattern->AND(aPattern(arg).release());
+ if (node->term == "?narrow")
+ return std::make_unique<Patterns::VersionIsAnyVersion>(std::move(pattern));
return pattern;
}
if (node->matches("?or", 0, -1))