Bladeren bron

* Skip version check if a build-dependency is provided ...
Author: mdz
Date: 2003-07-22 03:00:19 GMT
* Skip version check if a build-dependency is provided by an installed package
(Closes: #126938)

Arch Librarian 22 jaren geleden
bovenliggende
commit
cb99271c2b
2 gewijzigde bestanden met toevoegingen van 22 en 14 verwijderingen
  1. 20 13
      cmdline/apt-get.cc
  2. 2 1
      debian/changelog

+ 20 - 13
cmdline/apt-get.cc

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
 // Description								/*{{{*/
-// $Id: apt-get.cc,v 1.131 2003/07/22 01:49:26 mdz Exp $
+// $Id: apt-get.cc,v 1.132 2003/07/22 03:00:19 mdz Exp $
 /* ######################################################################
 /* ######################################################################
    
    
    apt-get - Cover for dpkg
    apt-get - Cover for dpkg
@@ -2093,25 +2093,32 @@ bool DoBuildDep(CommandLine &CmdL)
 	     * installed
 	     * installed
 	     */
 	     */
             pkgCache::PrvIterator Prv = Pkg.ProvidesList();
             pkgCache::PrvIterator Prv = Pkg.ProvidesList();
-            for (; Prv.end() != true; Prv++)
+            for (; Prv.end() != true; Prv++) {
 	       if ((*Cache)[Prv.OwnerPkg()].InstVerIter(*Cache).end() == false)
 	       if ((*Cache)[Prv.OwnerPkg()].InstVerIter(*Cache).end() == false)
 	          break;
 	          break;
+            }
             
             
             // Get installed version and version we are going to install
             // Get installed version and version we are going to install
 	    pkgCache::VerIterator IV = (*Cache)[Pkg].InstVerIter(*Cache);
 	    pkgCache::VerIterator IV = (*Cache)[Pkg].InstVerIter(*Cache);
-	    pkgCache::VerIterator CV = (*Cache)[Pkg].CandidateVerIter(*Cache);
 
 
-            for (; CV.end() != true; CV++)
-            {
-               if (Cache->VS().CheckDep(CV.VerStr(),(*D).Op,(*D).Version.c_str()) == true)
-                  break;
+            if (Prv.end() == true || (*D).Version != "") {
+                 /* We either have a versioned dependency (so a provides won't do)
+                    or nothing is providing this package */
+
+                 pkgCache::VerIterator CV = (*Cache)[Pkg].CandidateVerIter(*Cache);
+
+                 for (; CV.end() != true; CV++)
+                 {
+                      if (Cache->VS().CheckDep(CV.VerStr(),(*D).Op,(*D).Version.c_str()) == true)
+                           break;
+                 }
+                 if (CV.end() == true)
+                      return _error->Error(_("%s dependency for %s cannot be satisfied "
+                                             "because no available versions of package %s "
+                                             "can satisfy version requirements"),
+                                           Last->BuildDepType((*D).Type),Src.c_str(),
+                                           (*D).Package.c_str());
             }
             }
-            if (CV.end() == true)
-	       return _error->Error(_("%s dependency for %s cannot be satisfied "
-                                      "because no available versions of package %s "
-                                      "can satisfy version requirements"),
-				      Last->BuildDepType((*D).Type),Src.c_str(),
-                                      (*D).Package.c_str());
 
 
             /*
             /*
 	     * TODO: if we depend on a version lower than what we already have 
 	     * TODO: if we depend on a version lower than what we already have 

+ 2 - 1
debian/changelog

@@ -4,7 +4,8 @@ apt (0.5.7) unstable; urgency=low
     libapt-pkg-dev section libdevel)
     libapt-pkg-dev section libdevel)
   * Silence the essential packages check if we are only downloading
   * Silence the essential packages check if we are only downloading
     archives and not changing the system (Closes: #190862)
     archives and not changing the system (Closes: #190862)
-  * 
+  * Skip version check if a build-dependency is provided by an installed package
+    (Closes: #126938)
 
 
  --
  --