summaryrefslogtreecommitdiffstats
path: root/src/commands/tree_of.rs
diff options
context:
space:
mode:
authorMatthias Beyer <matthias.beyer@atos.net>2021-06-25 19:09:52 +0200
committerMatthias Beyer <matthias.beyer@atos.net>2021-09-16 12:32:18 +0200
commit3cc328a5f5857b95299d0ef998be5dcc3ddde6a7 (patch)
treeaf2945fe2dfdf111b766221f914538f32fbf20e9 /src/commands/tree_of.rs
parent7902138f93e397c8a41f0699e970924916d613b0 (diff)
Add passing of data for condition-check
This patch extends the interface for building the package DAG with a parameter for the data that is required to check conditions for conditional dependencies. A "DTO" type is added for this data. The actual condition-checking is not implemented in this patch. Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
Diffstat (limited to 'src/commands/tree_of.rs')
-rw-r--r--src/commands/tree_of.rs11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/commands/tree_of.rs b/src/commands/tree_of.rs
index 6b297e3..f5ce223 100644
--- a/src/commands/tree_of.rs
+++ b/src/commands/tree_of.rs
@@ -20,7 +20,11 @@ use resiter::AndThen;
use crate::package::Dag;
use crate::package::PackageName;
use crate::package::PackageVersionConstraint;
+use crate::package::condition::ConditionData;
use crate::repository::Repository;
+use crate::util::EnvironmentVariableName;
+use crate::util::docker::ImageName;
+use crate::util::progress::ProgressBars;
/// Implementation of the "tree_of" subcommand
pub async fn tree_of(
@@ -36,6 +40,11 @@ pub async fn tree_of(
.map(PackageVersionConstraint::try_from)
.transpose()?;
+ let condition_data = ConditionData {
+ image_name: None
+ env: &[],
+ };
+
repo.packages()
.filter(|p| pname.as_ref().map(|n| p.name() == n).unwrap_or(true))
.filter(|p| {
@@ -44,7 +53,7 @@ pub async fn tree_of(
.map(|v| v.matches(p.version()))
.unwrap_or(true)
})
- .map(|package| Dag::for_root_package(package.clone(), &repo, None))
+ .map(|package| Dag::for_root_package(package.clone(), &repo, None, &condition_data))
.and_then_ok(|tree| {
let stdout = std::io::stdout();
let mut outlock = stdout.lock();