Don't conflict with pkgs that are in the depPool

When upgrading multiple packages that are already installed we should
not conflict with already installed packages that are in the depPool.

This is because the version in the depTree is going to replace the
currently installed version of the package and may have different
conflicts.

If there is a conflict between stuff in the depPool these should be
handled by the innerConflicts check anyway.
This commit is contained in:
morganamilo 2018-05-19 05:30:21 +01:00
parent d51205194e
commit 6e990e4dc5
No known key found for this signature in database
GPG Key ID: 6FE9E7996B0B082E

View File

@ -33,7 +33,7 @@ func (dp *depPool) checkInnerConflict(name string, conflict string, conflicts ma
func (dp *depPool) checkForwardConflict(name string, conflict string, conflicts mapStringSet) { func (dp *depPool) checkForwardConflict(name string, conflict string, conflicts mapStringSet) {
dp.LocalDb.PkgCache().ForEach(func(pkg alpm.Package) error { dp.LocalDb.PkgCache().ForEach(func(pkg alpm.Package) error {
if pkg.Name() == name { if pkg.Name() == name || dp.hasPackage(pkg.Name()) {
return nil return nil
} }
@ -111,6 +111,10 @@ func (dp *depPool) checkForwardConflicts(conflicts mapStringSet) {
func (dp *depPool) checkReverseConflicts(conflicts mapStringSet) { func (dp *depPool) checkReverseConflicts(conflicts mapStringSet) {
dp.LocalDb.PkgCache().ForEach(func(pkg alpm.Package) error { dp.LocalDb.PkgCache().ForEach(func(pkg alpm.Package) error {
if dp.hasPackage(pkg.Name()) {
return nil
}
pkg.Conflicts().ForEach(func(conflict alpm.Depend) error { pkg.Conflicts().ForEach(func(conflict alpm.Depend) error {
dp.checkReverseConflict(pkg.Name(), conflict.String(), conflicts) dp.checkReverseConflict(pkg.Name(), conflict.String(), conflicts)
return nil return nil