diff options
Diffstat (limited to 'src/apply.rs')
| -rwxr-xr-x | src/apply.rs | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/apply.rs b/src/apply.rs index 423a8bc..dd5268d 100755 --- a/src/apply.rs +++ b/src/apply.rs @@ -163,16 +163,17 @@ pub fn apply_system(cfg: &Config, dry_run: bool, custom_config: Option<&Path>) - let installed_set: HashSet<String> = db.packages.keys().cloned().collect(); let mut to_remove: Vec<String> = installed_set.difference(&target_state).cloned().collect(); - if let Err(conflict_err) = resolver::check_conflicts(&required, &db) { - let msg = conflict_err.to_string(); - eprintln!("{} {}", "[ror]".yellow().bold(), msg); - if let Some(pkg_conflict) = msg.split("'").nth(3) { - let pkg = pkg_conflict.to_string(); - if !to_remove.contains(&pkg) { - to_remove.push(pkg); - } - } else { - return Err(conflict_err); + let installed_conflicts = resolver::find_installed_conflicts(&required, &db); + for (req_pkg, inst_pkg) in installed_conflicts { + eprintln!( + "{} Package '{}' conflicts with installed '{}'. Scheduling removal of '{}'.", + "[ror]".yellow().bold(), + req_pkg, + inst_pkg, + inst_pkg + ); + if !to_remove.contains(&inst_pkg) { + to_remove.push(inst_pkg); } } |