summaryrefslogtreecommitdiff
path: root/apt-pkg/cachefilter-patterns.cc
Commit message (Collapse)AuthorAgeFilesLines
* Implement ?reverse-depends/~R and friendsJulian Andres Klode2020-12-271-0/+28
| | | | This was easy.
* patterns: Add dependency patterns ?depends, ?conflicts, etc.Julian Andres Klode2020-12-271-0/+29
| | | | | | 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.
* patterns: Terminate short pattern by ~ and !Julian Andres Klode2020-12-071-1/+4
| | | | | | | | | | 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
* Don't crash pattern matching sections if pkg has no sectionDavid Kalnischkies2020-03-101-1/+1
| | | | | | | | 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.
* patterns: test for empty terms, reject themJulian Andres Klode2020-02-031-0/+3
|
* Correctly stop parsing short form arguments on space, also on ?Julian Andres Klode2020-02-031-8/+11
| | | | | | | | | 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))...
* patterns: Implement parsing of (...) groupsJulian Andres Klode2020-02-031-0/+26
|
* Implement | as orJulian Andres Klode2020-02-031-3/+41
|
* patterns: Allow rendering patterns as patterns instead of json-ishJulian Andres Klode2020-02-031-9/+10
|
* patterns: Parse sequence of patterns as ?andJulian Andres Klode2020-02-031-1/+31
|
* patterns: Allow bare words only in argumentsJulian Andres Klode2020-02-031-3/+15
| | | | | | | | | | | | | | | | 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
* patterns: Implement unary !Julian Andres Klode2020-02-031-1/+27
|
* Implement short patterns (patterns starting with ~)Julian Andres Klode2020-02-031-0/+57
| | | | | | 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.
* patterns: Use _sv literalsJulian Andres Klode2020-02-031-6/+6
| | | | | This will make it easier to extend those views, given that we do not need to hardcode their length.
* patterns: Provide Node constructor, simplify error throwingJulian Andres Klode2020-02-031-10/+3
| | | | | By having a node constructor, we can construct a node inline for error reporting needs, simplifying the code a bit.
* patterns: Add ?sectionJulian Andres Klode2019-11-261-0/+2
|
* patterns: Add ?all-versionsJulian Andres Klode2019-11-261-0/+2
|
* patterns: Implement ?narrow(...), as ?any-version(?and(...))Julian Andres Klode2019-11-261-1/+3
| | | | | This is pure syntactic sugar - ?narrow does not exist in the abstract syntax.
* patterns: Add ?any-versionJulian Andres Klode2019-11-261-0/+2
|
* patterns: Add ?originJulian Andres Klode2019-11-251-0/+2
|
* patterns: Add ?archiveJulian Andres Klode2019-11-251-0/+2
|
* patterns: Add ?source-name and ?source-versionJulian Andres Klode2019-11-251-0/+4
|
* patterns: Add ?versionJulian Andres Klode2019-11-251-0/+2
|
* patterns: Add base class for regular expression matchingJulian Andres Klode2019-11-251-0/+36
|
* patterns: Allow more complex wordsJulian Andres Klode2019-08-191-6/+4
| | | | | Only disallow ,() and on the start of a word also ~ and ?. Make sure to include \0 as disallowed.
* patterns: Improve error reporting at end of argument listJulian Andres Klode2019-08-151-1/+3
|
* Add ?virtual patternJulian Andres Klode2019-08-151-0/+2
| | | | This matches any package that does not have versions.
* Add the ?exact-name patternJulian Andres Klode2019-08-151-0/+2
| | | | | | The ?exact-name pattern matches the name exactly, there is no substring matching going on, or any regular expression or fnmatch magic.
* Add ?essential patternJulian Andres Klode2019-08-151-0/+2
| | | | | | This matches all packages where at least one of the versions is marked essential; or well, whenver apt considers a package essential.
* Add ?broken patternJulian Andres Klode2019-08-151-0/+2
| | | | | This matches all packages that have broken dependencies in the installed version or the version selected for install.
* Add ?config-files and ?installed patternsJulian Andres Klode2019-08-151-0/+4
| | | | | | 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.
* Add ?obsolete and ?upgradable patternsJulian Andres Klode2019-08-151-0/+4
| | | | | | | | | 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.
* Add ?automatic and ?garbage patternsJulian Andres Klode2019-08-151-0/+4
| | | | | | 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.
* Add patterns for the existing CacheFilter::Matcher classesJulian Andres Klode2019-08-151-0/+30
| | | | | | | This implements the basic logic patterns: ?and ?false ?not ?or ?true and the basic package patterns: ?architecture ?name ?x-name-fnmatch
* Add pattern tree parser infra and connect with cacheset and apt listJulian Andres Klode2019-08-151-0/+51
| | | | | This adds a transformation from parse tree into a CacheFilter and connects it with cachesets and the apt list command.
* Add initial support for parsing patterns into parse treesJulian Andres Klode2019-08-151-0/+205
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.