mirror of
https://gitlab.redox-os.org/redox-os/redox.git
synced 2026-11-05 04:06:38 +08:00
cookbook: Automatically determine tree roots
This commit is contained in:
parent
81bc5bf19a
commit
929a857012
@ -123,12 +123,20 @@ pub fn display_tree_entry(
|
||||
) -> Result<TreeData> {
|
||||
let mut data = TreeData::new();
|
||||
let num_roots = package_roots.len() - 1;
|
||||
let dependents = if matches!(display_opt, DisplayOptions::Csv) {
|
||||
let dependents = if matches!(display_opt, DisplayOptions::Csv | DisplayOptions::Tree) {
|
||||
Some(build_dependents(recipe_map, tree_opt))
|
||||
} else {
|
||||
None
|
||||
};
|
||||
for (i, name) in package_roots.iter().enumerate() {
|
||||
if matches!(display_opt, DisplayOptions::Tree)
|
||||
&& dependents
|
||||
.as_ref()
|
||||
.and_then(|h| h.get(name))
|
||||
.is_some_and(|e| !e.is_empty())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
walk_tree_entry(
|
||||
name,
|
||||
recipe_map,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user