From 6e990e4dc505c8fa9683d31dd98d6f325de45a48 Mon Sep 17 00:00:00 2001 From: morganamilo Date: Sat, 19 May 2018 05:30:21 +0100 Subject: [PATCH] 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. --- depCheck.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/depCheck.go b/depCheck.go index 47e762ff..9c14ed17 100644 --- a/depCheck.go +++ b/depCheck.go @@ -33,7 +33,7 @@ func (dp *depPool) checkInnerConflict(name string, conflict string, conflicts ma func (dp *depPool) checkForwardConflict(name string, conflict string, conflicts mapStringSet) { dp.LocalDb.PkgCache().ForEach(func(pkg alpm.Package) error { - if pkg.Name() == name { + if pkg.Name() == name || dp.hasPackage(pkg.Name()) { return nil } @@ -111,6 +111,10 @@ func (dp *depPool) checkForwardConflicts(conflicts mapStringSet) { func (dp *depPool) checkReverseConflicts(conflicts mapStringSet) { dp.LocalDb.PkgCache().ForEach(func(pkg alpm.Package) error { + if dp.hasPackage(pkg.Name()) { + return nil + } + pkg.Conflicts().ForEach(func(conflict alpm.Depend) error { dp.checkReverseConflict(pkg.Name(), conflict.String(), conflicts) return nil