Skip to content
This repository has been archived by the owner on Nov 7, 2024. It is now read-only.

Commit

Permalink
Fixing bug: empty bins
Browse files Browse the repository at this point in the history
  • Loading branch information
RishabhSaini committed Jan 31, 2023
1 parent 36e4652 commit 81c399d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/src/chunking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -553,12 +553,15 @@ fn basic_packing<'a>(
{
println!("Keeping old package structure");
let mut curr_build: Vec<Vec<String>> = prior_build.clone();
//Packing only manaages RPMs not OStree commit
curr_build.remove(0);
let mut prev_pkgs: Vec<String> = Vec::new();
for bin in prior_build {
for bin in &curr_build {
for pkg in bin {
prev_pkgs.push(pkg.to_string());
}
}
prev_pkgs.retain(|name| name != "");
let curr_pkgs: Vec<String> = components
.iter()
.map(|pkg| pkg.meta.name.to_string())
Expand All @@ -576,6 +579,7 @@ fn basic_packing<'a>(
rem_pkgs_v.push(pkg.to_string());
}
let curr_build_len = &curr_build.len();
curr_build[curr_build_len - 1].retain(|name| name != "");
curr_build[curr_build_len - 1].extend(add_pkgs_v);
for bin in curr_build.iter_mut() {
bin.retain(|pkg| !rem_pkgs_v.contains(&pkg));
Expand Down

0 comments on commit 81c399d

Please sign in to comment.