Selaa lähdekoodia

* apt-pkg/depcache.cc:
- merged from install-recommends
* debian/apt.conf.ubuntu:
- added "APT::Install-Recommends-Section" to "metapackages"
* renamed apt.conf.autoremove -> apt.conf.ubuntu

Michael Vogt 20 vuotta sitten
vanhempi
commit
3a089a0178
4 muutettua tiedostoa jossa 31 lisäystä ja 8 poistoa
  1. 21 5
      apt-pkg/depcache.cc
  2. 2 0
      debian/apt.conf.autoremove
  3. 7 2
      debian/changelog
  4. 1 1
      debian/rules

+ 21 - 5
apt-pkg/depcache.cc

@@ -873,6 +873,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(?)
@@ -881,9 +882,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)
@@ -1330,8 +1332,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);
 
 

+ 2 - 0
debian/apt.conf.autoremove

@@ -5,4 +5,6 @@ APT
 	"^linux-image.*";  
 	"^linux-image.*";  
 	"^linux-restricted-modules.*";
 	"^linux-restricted-modules.*";
   };
   };
+
+  Install-Recommends-Section "metapackages";
 };
 };

+ 7 - 2
debian/changelog

@@ -4,9 +4,14 @@ apt (0.6.45ubuntu6) edgy; urgency=low
   * cmdline/apt-get.cc:
   * cmdline/apt-get.cc:
     - always show auto-removable packages and give a hint how to remove 
     - always show auto-removable packages and give a hint how to remove 
       them
       them
-  * debian/apt.conf.autoremove:
+  * debian/apt.conf.ubuntu:
     - exlucde linux-image and linux-restricted-modules from ever being 
     - exlucde linux-image and linux-restricted-modules from ever being 
       auto-removed
       auto-removed
+    - added "metapackages" as the section we want to install recommends
+      by default
+  * apt-pkg/depcache.cc:
+    - added support to turn install-recommends selectively on/off by
+      section
   [Ian Jackson]
   [Ian Jackson]
   * Tests pass without code changes!  Except that we need this:
   * Tests pass without code changes!  Except that we need this:
   * Bump cache file major version to force rebuild so that Breaks
   * Bump cache file major version to force rebuild so that Breaks
@@ -17,7 +22,7 @@ apt (0.6.45ubuntu6) edgy; urgency=low
   * Initial draft of `Breaks' implementation.  Appears to compile,
   * Initial draft of `Breaks' implementation.  Appears to compile,
     but as yet *completely untested*.
     but as yet *completely untested*.
 
 
- -- 
+ -- Michael Vogt <michael.vogt@ubuntu.com>  Thu,  7 Sep 2006 11:50:52 +0200
 
 
 apt (0.6.45ubuntu5) edgy; urgency=low
 apt (0.6.45ubuntu5) edgy; urgency=low
 
 

+ 1 - 1
debian/rules

@@ -211,7 +211,7 @@ apt: build debian/shlibs.local
 	cp debian/bugscript debian/$@/usr/share/bug/apt/script
 	cp debian/bugscript debian/$@/usr/share/bug/apt/script
 
 
 	cp share/ubuntu-archive.gpg debian/$@/usr/share/$@
 	cp share/ubuntu-archive.gpg debian/$@/usr/share/$@
-	cp debian/apt.conf.autoremove debian/$@/etc/apt/apt.conf.d/01autoremove
+	cp debian/apt.conf.ubuntu debian/$@/etc/apt/apt.conf.d/01ubuntu
 #	head -n 500 ChangeLog > debian/ChangeLog
 #	head -n 500 ChangeLog > debian/ChangeLog
 
 
 	# make rosetta happy and remove pot files in po/ (but leave stuff
 	# make rosetta happy and remove pot files in po/ (but leave stuff