summaryrefslogtreecommitdiff
path: root/cmdline
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2011-05-11 16:05:30 +0200
committerDavid Kalnischkies <kalnischkies@gmail.com>2011-05-11 16:05:30 +0200
commit359e46db58b85497fd232fbe912b8a62e77079c5 (patch)
treee7586b45a7f16066e0535704b927876a44a44058 /cmdline
parentdf77d8a5fb5340b23fec5363f9a52704e940b048 (diff)
convert a lot of places to use IsNegative instead of checking by hand
for the three different dependencies
Diffstat (limited to 'cmdline')
-rw-r--r--cmdline/apt-cache.cc14
1 files changed, 4 insertions, 10 deletions
diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc
index f66c22c20..232bb93ec 100644
--- a/cmdline/apt-cache.cc
+++ b/cmdline/apt-cache.cc
@@ -121,9 +121,7 @@ bool ShowUnMet(pkgCache::VerIterator const &V, bool const &Important)
continue;
// Skip conflicts and replaces
- if (End->Type == pkgCache::Dep::DpkgBreaks ||
- End->Type == pkgCache::Dep::Replaces ||
- End->Type == pkgCache::Dep::Conflicts)
+ if (End.IsNegative() == true)
continue;
// Verify the or group
@@ -848,10 +846,7 @@ bool XVcg(CommandLine &CmdL)
{
/* If a conflicts does not meet anything in the database
then show the relation but do not recurse */
- if (Hit == false &&
- (D->Type == pkgCache::Dep::Conflicts ||
- D->Type == pkgCache::Dep::DpkgBreaks ||
- D->Type == pkgCache::Dep::Obsoletes))
+ if (Hit == false && D.IsNegative() == true)
{
if (Show[D.TargetPkg()->ID] == None &&
Show[D.TargetPkg()->ID] != ToShow)
@@ -1060,9 +1055,7 @@ bool Dotty(CommandLine &CmdL)
{
/* If a conflicts does not meet anything in the database
then show the relation but do not recurse */
- if (Hit == false &&
- (D->Type == pkgCache::Dep::Conflicts ||
- D->Type == pkgCache::Dep::Obsoletes))
+ if (Hit == false && D.IsNegative() == true)
{
if (Show[D.TargetPkg()->ID] == None &&
Show[D.TargetPkg()->ID] != ToShow)
@@ -1082,6 +1075,7 @@ bool Dotty(CommandLine &CmdL)
{
case pkgCache::Dep::Conflicts:
case pkgCache::Dep::Obsoletes:
+ case pkgCache::Dep::DpkgBreaks:
printf("[color=springgreen];\n");
break;