]> git.saurik.com Git - apt.git/commitdiff
* apt-pkg/depcache.cc:
authorMichael Vogt <michael.vogt@ubuntu.com>
Thu, 7 Sep 2006 09:52:58 +0000 (11:52 +0200)
committerMichael Vogt <michael.vogt@ubuntu.com>
Thu, 7 Sep 2006 09:52:58 +0000 (11:52 +0200)
  - merged from install-recommends
* debian/apt.conf.ubuntu:
  - added "APT::Install-Recommends-Section" to "metapackages"
* renamed apt.conf.autoremove -> apt.conf.ubuntu

apt-pkg/depcache.cc
debian/apt.conf.autoremove [deleted file]
debian/apt.conf.ubuntu [new file with mode: 0644]
debian/changelog
debian/rules

index 4d193dc2e81fd0fc19e567cd15f46d10278ba145..740d14426cffd447668c977aac2435c7567f916a 100644 (file)
@@ -873,6 +873,7 @@ void pkgDepCache::MarkInstall(PkgIterator const &Pkg,bool AutoInst,
         bool found=false;
         VerIterator instVer = Pkg.CurrentVer();
         if(!instVer.end())
+        {
            for (DepIterator D = instVer.DependsList(); D.end() != true; D++)
            {
               //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())
                  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(_config->FindB("Debug::pkgDepCache::AutoInstall",false) == true)
@@ -1330,8 +1332,22 @@ bool pkgDepCache::Policy::IsImportantDep(DepIterator Dep)
 {
    if(Dep.IsCritical())
       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)
      return _config->FindB("APT::Install-Suggests", false);
 
diff --git a/debian/apt.conf.autoremove b/debian/apt.conf.autoremove
deleted file mode 100644 (file)
index 98143ce..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-APT
-{
-  NeverAutoRemove  
-  { 
-       "^linux-image.*";  
-       "^linux-restricted-modules.*";
-  };
-};
diff --git a/debian/apt.conf.ubuntu b/debian/apt.conf.ubuntu
new file mode 100644 (file)
index 0000000..8d095f1
--- /dev/null
@@ -0,0 +1,10 @@
+APT
+{
+  NeverAutoRemove  
+  { 
+       "^linux-image.*";  
+       "^linux-restricted-modules.*";
+  };
+
+  Install-Recommends-Section "metapackages";
+};
index d8f90ba403f25e9b0a397d8b7d896da5e89fd017..0bd5e45329f199dd0938e0d01323cdff276505b5 100644 (file)
@@ -4,9 +4,14 @@ apt (0.6.45ubuntu6) edgy; urgency=low
   * cmdline/apt-get.cc:
     - always show auto-removable packages and give a hint how to remove 
       them
-  * debian/apt.conf.autoremove:
+  * debian/apt.conf.ubuntu:
     - exlucde linux-image and linux-restricted-modules from ever being 
       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]
   * Tests pass without code changes!  Except that we need this:
   * 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,
     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
 
index ffc23402ece74a6758e21cf73ee21cefc57a0bf3..2007370c45fb01526ea709c9f8f98beca00d49f7 100755 (executable)
@@ -211,7 +211,7 @@ apt: build debian/shlibs.local
        cp debian/bugscript debian/$@/usr/share/bug/apt/script
 
        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
 
        # make rosetta happy and remove pot files in po/ (but leave stuff