浏览代码

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.
morganamilo 7 年之前
父节点
当前提交
7b558ba47c
共有 1 个文件被更改,包括 10 次插入5 次删除
  1. 10 5
      depCheck.go

+ 10 - 5
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
 		})