summaryrefslogtreecommitdiffstats
path: root/src/util/filters.rs
AgeCommit message (Collapse)Author
2021-01-18Run `cargo fmt`Matthias Beyer
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-01-15Fix clippy: return the expression directlyMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2021-01-13Add LICENSE file and license headersMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-07Deny macro_use from external crateMatthias Beyer
Diesel is an exception here, because the generated src/schema.rs file does not automatically contain the necessary imports. All imports were added where necessary. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-03Remove the idea of "system dependencies"Matthias Beyer
Because we want to be able to work on different distros, we cannot have a concept of "system dependencies", because each distro names their packages differently. The concept of installing stuff from a distro image can still be accomplished easily via environment variables. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-11-09Add filter generation helper: filter by version constraintMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-11-08Remove unused imports, sort importsMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-11-08Fix: build_package_filter_by_dependency_name() filters can failMatthias Beyer
This fixes an issue with the build_package_filter_by_dependency_name() function, which generated a filters::filter::Filter<Package>. Though, these filters can fail because the dependency string it filters for must be parsed to be matched against. Because the `Package` type does not store the parsed information, but the "raw" string from the TOML, this parsing process is necessary. This patch changes the function to return a failable filter (a filter that returns `Result<bool>`). These results must be handled in the main() function (actually in the subcommand implementation), which is done in this patch as well. Tests were adapted accordingly, which required adding a proper version constraint string in the test Package instances. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-11-08Add debug outputMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-11-04Remove all non-equality "Version constraint" implementationMatthias Beyer
This patch removes the idea of "version constraints" except for the equality constraint. This is due to the fact, that everything else might result in impurities. This might be reverted in the future and actual operators ("<" or ">" or ranges...) might be implemented. Thus, we keep the "=" equality sign as prefix for a version string, to be extensible here. This commit also fixes (automatically, because the implementation changed from the ground up) the issue that there was no difference between a version string and a version constraint string. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-11-02Implement depsof subcommandMatthias Beyer
2020-10-29Fix: Rename functions, remove CLI optionMatthias Beyer
This removes the "version constraint" CLI option for the what-depends subcommand, because we're filtering by dependency here, not by package. Also, this renames the filter builder helper function accordingly. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-10-29Move package filtering to util moduleMatthias Beyer
This moves the package filtering code to a module, to make it independent of the CLI code. This gives us the ability to test this code, which is also implemented in this commit. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>