Sfoglia il codice sorgente

* merged from the apt--install-recommends branch

Michael Vogt 20 anni fa
parent
commit
92bd79d048
2 ha cambiato i file con 21 aggiunte e 5 eliminazioni
  1. 21 5
      apt-pkg/depcache.cc
  2. BIN
      share/debian-archive.gpg.moved.moved

+ 21 - 5
apt-pkg/depcache.cc

@@ -864,6 +864,7 @@ void pkgDepCache::MarkInstall(PkgIterator const &Pkg,bool AutoInst,
 	 bool found=false;
 	 bool found=false;
 	 VerIterator instVer = Pkg.CurrentVer();
 	 VerIterator instVer = Pkg.CurrentVer();
 	 if(!instVer.end())
 	 if(!instVer.end())
+	 {
 	    for (DepIterator D = instVer.DependsList(); D.end() != true; D++)
 	    for (DepIterator D = instVer.DependsList(); D.end() != true; D++)
 	    {
 	    {
 	       //FIXME: deal better with or-groups(?)
 	       //FIXME: deal better with or-groups(?)
@@ -872,9 +873,10 @@ void pkgDepCache::MarkInstall(PkgIterator const &Pkg,bool AutoInst,
 	       if(IsImportantDep(D) && Start.TargetPkg() == D.TargetPkg())
 	       if(IsImportantDep(D) && Start.TargetPkg() == D.TargetPkg())
 		  found=true;
 		  found=true;
 	    }
 	    }
-	 // this is a new dep if it was not found to be already
-	 // a important dep of the installed pacakge
-	 isNewImportantDep = !found;
+	    // this is a new dep if it was not found to be already
+	    // a important dep of the installed pacakge
+	    isNewImportantDep = !found;
+	 }
       }
       }
       if(isNewImportantDep)
       if(isNewImportantDep)
 	 if(_config->FindB("Debug::pkgDepCache::AutoInstall",false) == true)
 	 if(_config->FindB("Debug::pkgDepCache::AutoInstall",false) == true)
@@ -1099,8 +1101,22 @@ bool pkgDepCache::Policy::IsImportantDep(DepIterator Dep)
 {
 {
    if(Dep.IsCritical())
    if(Dep.IsCritical())
       return true;
       return true;
-   else if(Dep->Type == pkgCache::Dep::Recommends)
-      return  _config->FindB("APT::Install-Recommends", false);
+   else if(Dep->Type == pkgCache::Dep::Recommends) 
+   {
+      if ( _config->FindB("APT::Install-Recommends", false))
+	 return true;
+      // we suport a special mode to only install-recommends for certain
+      // sections
+      // FIXME: this is a meant as a temporarly solution until the 
+      //        recommends are cleaned up
+      string s = _config->Find("APT::Install-Recommends-Section","");
+      if(s.size() > 0) 
+      {
+	 const char *sec = Dep.TargetPkg().Section();
+	 if (sec && strcmp(sec, s.c_str()) == 0)
+	    return true;
+      }
+   }
    else if(Dep->Type == pkgCache::Dep::Suggests)
    else if(Dep->Type == pkgCache::Dep::Suggests)
      return _config->FindB("APT::Install-Suggests", false);
      return _config->FindB("APT::Install-Suggests", false);
 
 

BIN
share/debian-archive.gpg.moved.moved