From 7b558ba47ca5cfec42934bf5ca9ae232431d885e Mon Sep 17 00:00:00 2001 From: morganamilo Date: Tue, 8 May 2018 22:54:28 +0100 Subject: [PATCH] Fix check for missing dependencies We dont check the dependencies of things already installed becuase, well, they're already installed. But we should check the dependencies of targets even if they are installed because they get reinstalled. --- depCheck.go | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/depCheck.go b/depCheck.go index de6a4635..47e762ff 100644 --- a/depCheck.go +++ b/depCheck.go @@ -183,11 +183,6 @@ type missing struct { } func (dp *depPool) _checkMissing(dep string, stack []string, missing *missing) { - if _, err := dp.LocalDb.PkgCache().FindSatisfier(dep); err == nil { - missing.Good.set(dep) - return - } - if missing.Good.get(dep) { return } @@ -207,6 +202,11 @@ func (dp *depPool) _checkMissing(dep string, stack []string, missing *missing) { missing.Good.set(dep) for _, deps := range [3][]string{aurPkg.Depends, aurPkg.MakeDepends, aurPkg.CheckDepends} { for _, aurDep := range deps { + if _, err := dp.LocalDb.PkgCache().FindSatisfier(aurDep); err == nil { + missing.Good.set(aurDep) + continue + } + dp._checkMissing(aurDep, append(stack, aurPkg.Name), missing) } } @@ -218,6 +218,11 @@ func (dp *depPool) _checkMissing(dep string, stack []string, missing *missing) { if repoPkg != nil { missing.Good.set(dep) repoPkg.Depends().ForEach(func(repoDep alpm.Depend) error { + if _, err := dp.LocalDb.PkgCache().FindSatisfier(repoDep.String()); err == nil { + missing.Good.set(repoDep.String()) + return nil + } + dp._checkMissing(repoDep.String(), append(stack, repoPkg.Name()), missing) return nil })