Przeglądaj źródła

Check candidate version when installing build-deps. Clo...
Author: tausq
Date: 2003-02-02 03:30:52 GMT
Check candidate version when installing build-deps. Closes: #178121

Arch Librarian 22 lat temu
rodzic
commit
e5002e30de
2 zmienionych plików z 20 dodań i 5 usunięć
  1. 18 5
      cmdline/apt-get.cc
  2. 2 0
      debian/changelog

+ 18 - 5
cmdline/apt-get.cc

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
 // Description								/*{{{*/
-// $Id: apt-get.cc,v 1.124 2003/02/01 20:18:46 tausq Exp $
+// $Id: apt-get.cc,v 1.125 2003/02/02 03:30:53 tausq Exp $
 /* ######################################################################
 /* ######################################################################
    
    
    apt-get - Cover for dpkg
    apt-get - Cover for dpkg
@@ -1945,7 +1945,7 @@ bool DoBuildDep(CommandLine &CmdL)
             {
             {
                // Check if there are any alternatives
                // Check if there are any alternatives
                if (((*D).Op & pkgCache::Dep::Or) != pkgCache::Dep::Or)
                if (((*D).Op & pkgCache::Dep::Or) != pkgCache::Dep::Or)
-	          return _error->Error(_("%s dependency on %s cannot be satisfied "
+	          return _error->Error(_("%s dependency for %s cannot be satisfied "
                                          "because the package %s cannot be found"),
                                          "because the package %s cannot be found"),
 				         Last->BuildDepType((*D).Type),Src.c_str(),
 				         Last->BuildDepType((*D).Type),Src.c_str(),
                                          (*D).Package.c_str());
                                          (*D).Package.c_str());
@@ -1967,9 +1967,6 @@ bool DoBuildDep(CommandLine &CmdL)
                    (((*D).Op & pkgCache::Dep::Or) == pkgCache::Dep::Or))
                    (((*D).Op & pkgCache::Dep::Or) == pkgCache::Dep::Or))
                D++;
                D++;
                        
                        
-            // Get installed versions
-	    pkgCache::VerIterator IV = (*Cache)[Pkg].InstVerIter(*Cache);
-
 	    /* 
 	    /* 
 	     * If this is a virtual package, we need to check the list of
 	     * If this is a virtual package, we need to check the list of
 	     * packages that provide it and see if any of those are
 	     * packages that provide it and see if any of those are
@@ -1979,6 +1976,22 @@ bool DoBuildDep(CommandLine &CmdL)
             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
+	    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 (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 - 0
debian/changelog

@@ -82,6 +82,8 @@ apt (0.5.5) unstable; urgency=low
   * Double default value of APT::Cache-Limit, until such time as it
   * Double default value of APT::Cache-Limit, until such time as it
     can be made more dynamic.  Closes: #178623.
     can be made more dynamic.  Closes: #178623.
   * Report uris with '.gz' when there are errors.  Closes: #178435.
   * Report uris with '.gz' when there are errors.  Closes: #178435.
+  * When installing build-deps, make sure the new version will 
+    satisfy build requirements. Closes: #178121
 
 
  -- Jason Gunthorpe <jgg@debian.org>  Sun, 15 Sep 2002 17:16:59 -0600
  -- Jason Gunthorpe <jgg@debian.org>  Sun, 15 Sep 2002 17:16:59 -0600