summaryrefslogtreecommitdiff
path: root/apt-pkg/cachefilter-patterns.cc
AgeCommit message (Collapse)Author
2020-12-27Implement ?reverse-depends/~R and friendsJulian Andres Klode
This was easy.
2020-12-27patterns: Add dependency patterns ?depends, ?conflicts, etc.Julian Andres Klode
These match the target package, not target versions which is slightly unfortunate but might make sense. Maybe we should add a version that matches Versions instead.
2020-12-07patterns: Terminate short pattern by ~ and !Julian Andres Klode
This allows patterns like ~nalpha~nbeta and ~nalpha!~nbeta to work like they do in APT. Also add a comment to remind readers that everything in START should be in short too. Cc: stable >= 2.0
2020-03-10Don't crash pattern matching sections if pkg has no sectionDavid Kalnischkies
Packages from third-party sources do not always follow the established patterns of more properly maintained archives. In that case it was a driver package for a scanner&printer device which has only a minimum of info attached, but also minimal non-installed packages do not include sections, so we really shouldn't assume their availability.
2020-02-03patterns: test for empty terms, reject themJulian Andres Klode
2020-02-03Correctly stop parsing short form arguments on space, also on ?Julian Andres Klode
we have to stop parsing on space so that things like ~ramd64 | ~rall work correctly. aptitude does not stop parsing on ?, but we'll do as it gets very confusing otherwise if you write stuff like ~ramd64?name(foo), and it resolves to ?and(?architecture(amd64?name), (foo))...
2020-02-03patterns: Implement parsing of (...) groupsJulian Andres Klode
2020-02-03Implement | as orJulian Andres Klode
2020-02-03patterns: Allow rendering patterns as patterns instead of json-ishJulian Andres Klode
2020-02-03patterns: Parse sequence of patterns as ?andJulian Andres Klode
2020-02-03patterns: Allow bare words only in argumentsJulian Andres Klode
This changes the syntax from approximately expr = unary unary = '!'? primary primary = pattern | short-pattern | word | quoted-word pattern = '?' name [ '(' expr [',' expr]* ')' ] short-pattern = ~ name | ~name expr to: primary = pattern | short-pattern argument = word | quoted-word | expr pattern = '?' name [ '(' argument [',' argument]* ')' ] short-pattern = ~ name | ~name argument
2020-02-03patterns: Implement unary !Julian Andres Klode
2020-02-03Implement short patterns (patterns starting with ~)Julian Andres Klode
Also make pattern detector in cacheset and private's list accept such patterns. We probably should just try to parse and see if it is a (start of a) pattern.
2020-02-03patterns: Use _sv literalsJulian Andres Klode
This will make it easier to extend those views, given that we do not need to hardcode their length.
2020-02-03patterns: Provide Node constructor, simplify error throwingJulian Andres Klode
By having a node constructor, we can construct a node inline for error reporting needs, simplifying the code a bit.
2019-11-26patterns: Add ?sectionJulian Andres Klode
2019-11-26patterns: Add ?all-versionsJulian Andres Klode
2019-11-26patterns: Implement ?narrow(...), as ?any-version(?and(...))Julian Andres Klode
This is pure syntactic sugar - ?narrow does not exist in the abstract syntax.
2019-11-26patterns: Add ?any-versionJulian Andres Klode
2019-11-25patterns: Add ?originJulian Andres Klode
2019-11-25patterns: Add ?archiveJulian Andres Klode
2019-11-25patterns: Add ?source-name and ?source-versionJulian Andres Klode
2019-11-25patterns: Add ?versionJulian Andres Klode
2019-11-25patterns: Add base class for regular expression matchingJulian Andres Klode
2019-08-19patterns: Allow more complex wordsJulian Andres Klode
Only disallow ,() and on the start of a word also ~ and ?. Make sure to include \0 as disallowed.
2019-08-15patterns: Improve error reporting at end of argument listJulian Andres Klode
2019-08-15Add ?virtual patternJulian Andres Klode
This matches any package that does not have versions.
2019-08-15Add the ?exact-name patternJulian Andres Klode
The ?exact-name pattern matches the name exactly, there is no substring matching going on, or any regular expression or fnmatch magic.
2019-08-15Add ?essential patternJulian Andres Klode
This matches all packages where at least one of the versions is marked essential; or well, whenver apt considers a package essential.
2019-08-15Add ?broken patternJulian Andres Klode
This matches all packages that have broken dependencies in the installed version or the version selected for install.
2019-08-15Add ?config-files and ?installed patternsJulian Andres Klode
These two are mutually exclusive states of installed-ness. And ?installed package is fully unpacked and configured; a ?config-files package only has config files left.
2019-08-15Add ?obsolete and ?upgradable patternsJulian Andres Klode
These match packages that have no version in a repository, or where an upgrade is available. Notably, ?and(?obsolete,?upgradable) == ?false because an upgradable package is by definition not obsolete.
2019-08-15Add ?automatic and ?garbage patternsJulian Andres Klode
These patterns allow you to identify automatically installed packages, as well as automatically installed packages that are no longer reachable from the manually installed ones.
2019-08-15Add patterns for the existing CacheFilter::Matcher classesJulian Andres Klode
This implements the basic logic patterns: ?and ?false ?not ?or ?true and the basic package patterns: ?architecture ?name ?x-name-fnmatch
2019-08-15Add pattern tree parser infra and connect with cacheset and apt listJulian Andres Klode
This adds a transformation from parse tree into a CacheFilter and connects it with cachesets and the apt list command.
2019-08-15Add initial support for parsing patterns into parse treesJulian Andres Klode
Introduce a parser for patterns that generates a parse tree. The language understood by the parser is: pattern = '?'TERM | '?'TERM '(' pattern (',' pattern)* ','? ')' | WORD | QUOTED-WORD TERM = [0-9a-zA-Z-] WORD = [0-9a-ZA-Z-.*^$\[\]_\\] QUOTED_WORD = "..." # you know what I mean This language is context free, which is a massive simplification from aptitude's language, where ?foo(bar) could have two different meanings depending on whether ?foo takes an argument or not.