Просмотр исходного кода

Bug 87390
Author: jgg
Date: 2001-03-03 23:27:24 GMT
Bug 87390

Arch Librarian лет назад: 22
Родитель
Сommit
6aeda9fa85
2 измененных файлов с 19 добавлено и 3 удалено
  1. 16 2
      apt-pkg/policy.cc
  2. 3 1
      debian/changelog

+ 16 - 2
apt-pkg/policy.cc

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
 // Description								/*{{{*/
-// $Id: policy.cc,v 1.2 2001/02/20 07:03:17 jgg Exp $
+// $Id: policy.cc,v 1.3 2001/03/03 23:27:24 jgg Exp $
 /* ######################################################################
 /* ######################################################################
 
 
    Package Version Policy implementation
    Package Version Policy implementation
@@ -145,9 +145,23 @@ pkgCache::VerIterator pkgPolicy::GetCandidateVer(pkgCache::PkgIterator Pkg)
       pin that stays at that setting.
       pin that stays at that setting.
     */
     */
    for (pkgCache::VerIterator Ver = Pkg.VersionList(); Ver.end() == false; Ver++)
    for (pkgCache::VerIterator Ver = Pkg.VersionList(); Ver.end() == false; Ver++)
-   {      
+   {     
+      /* This is a side effect of the condition below, and is added for
+         completeness, though it should not be necessary */
+      if (Ver->Arch == 0)
+	 continue;
+      
       for (pkgCache::VerFileIterator VF = Ver.FileList(); VF.end() == false; VF++)
       for (pkgCache::VerFileIterator VF = Ver.FileList(); VF.end() == false; VF++)
       {
       {
+	 /* If this is the status file, and the current version is not the
+	    version in the status file (ie it is not installed, or somesuch)
+	    then it is not a candidate for installation, ever. This weeds
+	    out bogus entries that may be due to config-file states, or
+	    other. */
+	 if ((VF.File()->Flags & pkgCache::Flag::NotSource) == pkgCache::Flag::NotSource &&
+	     Pkg.CurrentVer() != Ver)
+	    continue;
+	 	 	 
 	 signed Prio = PFPriority[VF.File()->ID];
 	 signed Prio = PFPriority[VF.File()->ID];
 	 if (Prio > Max)
 	 if (Prio > Max)
 	 {
 	 {

+ 3 - 1
debian/changelog

@@ -15,7 +15,9 @@ apt (0.5.1) unstable; urgency=low
   * apt-extracttemplates moved from debconf into apt-utils
   * apt-extracttemplates moved from debconf into apt-utils
   * s390 archtable entry. Closes: #88232
   * s390 archtable entry. Closes: #88232
   * Dan's segfault
   * Dan's segfault
-  
+  * Some instances where the status file can source a package in a
+    non-sensical way. Closes: #87390
+    
  -- Jason Gunthorpe <jgg@debian.org>  Thu, 22 Feb 2001 00:39:15 -0500
  -- Jason Gunthorpe <jgg@debian.org>  Thu, 22 Feb 2001 00:39:15 -0500
 
 
 apt (0.5.0) unstable; urgency=low
 apt (0.5.0) unstable; urgency=low