diff options
-rw-r--r-- | cmdline/apt-cache.cc | 8 | ||||
-rw-r--r-- | debian/changelog | 2 | ||||
-rw-r--r-- | doc/apt-cache.8.xml | 2 |
3 files changed, 9 insertions, 3 deletions
diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc index d73111b6a..a73e35a53 100644 --- a/cmdline/apt-cache.cc +++ b/cmdline/apt-cache.cc @@ -555,6 +555,7 @@ bool Depends(CommandLine &CmdL) bool Recurse = _config->FindB("APT::Cache::RecurseDepends",false); bool Installed = _config->FindB("APT::Cache::Installed",false); + bool Important = _config->FindB("APT::Cache::Important",false); bool DidSomething; do { @@ -577,7 +578,12 @@ bool Depends(CommandLine &CmdL) 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(); if((Installed && Trg->CurrentVer != 0) || !Installed) diff --git a/debian/changelog b/debian/changelog index c788c1d7d..24f876e44 100644 --- a/debian/changelog +++ b/debian/changelog @@ -29,7 +29,7 @@ apt (0.7.15) UNRELEASED; urgency=low [ Dereck Wonnacott ] * apt-ftparchive might write corrupt Release files (LP: #46439) - + * Apply --important option to apt-cache depends (LP: #16947) -- diff --git a/doc/apt-cache.8.xml b/doc/apt-cache.8.xml index c1e65332d..c359ac3d8 100644 --- a/doc/apt-cache.8.xml +++ b/doc/apt-cache.8.xml @@ -289,7 +289,7 @@ Reverse Provides: </varlistentry> <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. Configuration Item: <literal>APT::Cache::Important</literal>.</para></listitem> </varlistentry> |