mirror of
https://github.com/mudler/luet.git
synced 2025-09-16 15:19:24 +00:00
Use ConflictsWith to check conflicts when uninstalling packages
This commit is contained in:
@@ -589,8 +589,13 @@ func (s *Solver) Uninstall(checkconflicts, full bool, packs ...pkg.Package) (pkg
|
||||
// be removed). Let's only check if we can remove the selected package
|
||||
if !full && checkconflicts {
|
||||
for _, candidate := range toRemove {
|
||||
if conflicts, err := s.Conflicts(candidate, s.Installed()); conflicts {
|
||||
return nil, err
|
||||
if conflicts, _ := s.ConflictsWith(candidate, s.Installed()); conflicts {
|
||||
revdeps, _ := s.InstalledDatabase.GetRevdeps(candidate)
|
||||
packs := ""
|
||||
for _, p := range revdeps {
|
||||
packs += " " + p.HumanReadableString()
|
||||
}
|
||||
return nil, errors.New("Package " + candidate.HumanReadableString() + "has conflicts: required by " + packs)
|
||||
}
|
||||
}
|
||||
return toRemove, nil
|
||||
|
Reference in New Issue
Block a user