Przeglądaj źródła

* Apply --important option to apt-cache depends (LP: #16947)

Michael Vogt 18 lat temu
rodzic
commit
5aa95c863d
3 zmienionych plików z 9 dodań i 3 usunięć
  1. 7 1
      cmdline/apt-cache.cc
  2. 1 1
      debian/changelog
  3. 1 1
      doc/apt-cache.8.xml

+ 7 - 1
cmdline/apt-cache.cc

@@ -555,6 +555,7 @@ bool Depends(CommandLine &CmdL)
    
    
    bool Recurse = _config->FindB("APT::Cache::RecurseDepends",false);
    bool Recurse = _config->FindB("APT::Cache::RecurseDepends",false);
    bool Installed = _config->FindB("APT::Cache::Installed",false);
    bool Installed = _config->FindB("APT::Cache::Installed",false);
+   bool Important = _config->FindB("APT::Cache::Important",false);
    bool DidSomething;
    bool DidSomething;
    do
    do
    {
    {
@@ -577,7 +578,12 @@ bool Depends(CommandLine &CmdL)
 	 
 	 
 	 for (pkgCache::DepIterator D = Ver.DependsList(); D.end() == false; D++)
 	 for (pkgCache::DepIterator D = Ver.DependsList(); D.end() == false; D++)
 	 {
 	 {
-
+	    // Important deps only
+	    if (Important == true)
+	       if (D->Type != pkgCache::Dep::PreDepends &&
+		   D->Type != pkgCache::Dep::Depends)
+		  continue;
+		  
 	    pkgCache::PkgIterator Trg = D.TargetPkg();
 	    pkgCache::PkgIterator Trg = D.TargetPkg();
 
 
 	    if((Installed && Trg->CurrentVer != 0) || !Installed)
 	    if((Installed && Trg->CurrentVer != 0) || !Installed)

+ 1 - 1
debian/changelog

@@ -29,7 +29,7 @@ apt (0.7.15) UNRELEASED; urgency=low
 
 
   [ Dereck Wonnacott ]
   [ Dereck Wonnacott ]
   * apt-ftparchive might write corrupt Release files (LP: #46439)
   * apt-ftparchive might write corrupt Release files (LP: #46439)
-
+  * Apply --important option to apt-cache depends (LP: #16947) 
 
 
  --
  --
 
 

+ 1 - 1
doc/apt-cache.8.xml

@@ -289,7 +289,7 @@ Reverse Provides:
      </varlistentry>
      </varlistentry>
 
 
      <varlistentry><term><option>-i</option></term><term><option>--important</option></term>
      <varlistentry><term><option>-i</option></term><term><option>--important</option></term>
-     <listitem><para>Print only important dependencies; for use with unmet. Causes only Depends and 
+     <listitem><para>Print only important dependencies; for use with unmet and depends. Causes only Depends and 
      Pre-Depends relations to be printed.
      Pre-Depends relations to be printed.
      Configuration Item: <literal>APT::Cache::Important</literal>.</para></listitem>
      Configuration Item: <literal>APT::Cache::Important</literal>.</para></listitem>
      </varlistentry>
      </varlistentry>