浏览代码

show non-matching m-a:same versions in debug message

Slightly rewriting the code to ensure we only use two sources for the
versions as it could otherwise be confusing to look at.
David Kalnischkies 11 年之前
父节点
当前提交
98c9c26c12
共有 1 个文件被更改,包括 11 次插入6 次删除
  1. 11 6
      apt-pkg/depcache.cc

+ 11 - 6
apt-pkg/depcache.cc

@@ -1315,14 +1315,18 @@ bool pkgDepCache::IsInstallOkMultiArchSameVersionSynced(PkgIterator const &Pkg,
    GrpIterator const Grp = Pkg.Group();
    GrpIterator const Grp = Pkg.Group();
    for (PkgIterator P = Grp.PackageList(); P.end() == false; P = Grp.NextPkg(P))
    for (PkgIterator P = Grp.PackageList(); P.end() == false; P = Grp.NextPkg(P))
    {
    {
-      // not installed or version synced: fine by definition
+      // not installed or self-check: fine by definition
+      if (P->CurrentVer == 0 || P == Pkg)
+	 continue;
+
+      // not having a candidate or being in sync
       // (simple string-compare as stuff like '1' == '0:1-0' can't happen here)
       // (simple string-compare as stuff like '1' == '0:1-0' can't happen here)
-      if (P->CurrentVer == 0 || strcmp(Pkg.CandVersion(), P.CandVersion()) == 0)
+      VerIterator CV = PkgState[P->ID].CandidateVerIter(*this);
+      if (CV.end() == true || strcmp(Pkg.CandVersion(), CV.VerStr()) == 0)
 	 continue;
 	 continue;
+
       // packages losing M-A:same can be out-of-sync
       // packages losing M-A:same can be out-of-sync
-      VerIterator CV = PkgState[P->ID].CandidateVerIter(*this);
-      if (unlikely(CV.end() == true) ||
-	    (CV->MultiArch & pkgCache::Version::Same) != pkgCache::Version::Same)
+      if ((CV->MultiArch & pkgCache::Version::Same) != pkgCache::Version::Same)
 	 continue;
 	 continue;
 
 
       // not downloadable means the package is obsolete, so allow out-of-sync
       // not downloadable means the package is obsolete, so allow out-of-sync
@@ -1332,7 +1336,8 @@ bool pkgDepCache::IsInstallOkMultiArchSameVersionSynced(PkgIterator const &Pkg,
       PkgState[Pkg->ID].iFlags |= AutoKept;
       PkgState[Pkg->ID].iFlags |= AutoKept;
       if (unlikely(DebugMarker == true))
       if (unlikely(DebugMarker == true))
 	 std::clog << OutputInDepth(Depth) << "Ignore MarkInstall of " << Pkg
 	 std::clog << OutputInDepth(Depth) << "Ignore MarkInstall of " << Pkg
-	    << " as its M-A:same siblings are not version-synced" << std::endl;
+	    << " as it is not in sync with its M-A:same sibling " << P
+	    << " (" << Pkg.CandVersion() << " != " << CV.VerStr() << ")" << std::endl;
       return false;
       return false;
    }
    }