Make build stats count missing build

This commit is contained in:
Wildan M 2026-02-08 13:19:08 +07:00
parent 448da392ac
commit 81837d0198
No known key found for this signature in database
GPG Key ID: 01AC53185C679C79
2 changed files with 32 additions and 12 deletions

View File

@ -841,16 +841,30 @@ fn handle_tree(
}
println!("");
println!(
"Estimated image size: {} of {} {}",
tree::format_size(total_size),
visited.len(),
if visited.len() == 1 {
"package"
} else {
"packages"
},
);
if is_build_tree {
println!(
"Build summary: {} need build, {} may rebuild, with total of {} {}",
total_size,
roots.len(),
visited.len(),
if visited.len() == 1 {
"recipe"
} else {
"recipes"
},
);
} else {
println!(
"Estimated image size: {} of {} {}",
tree::format_size(total_size),
visited.len(),
if visited.len() == 1 {
"package"
} else {
"packages"
},
);
}
Ok(())
}

View File

@ -72,8 +72,14 @@ pub fn walk_tree_entry(
}
visited.insert(package_name.clone());
if let WalkTreeEntry::Built(_p, pkg_size) = &entry {
*total_size += pkg_size;
if is_build_tree {
if matches!(entry, WalkTreeEntry::NotBuilt) {
*total_size += 1;
}
} else {
if let WalkTreeEntry::Built(_p, pkg_size) = &entry {
*total_size += pkg_size;
}
}
let pkg_meta: Package;