From 6070a3461841d4398d731fcb33792d55779111f1 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 16 Apr 2011 01:10:09 +0200 Subject: fix a bunch of cppcheck warnings/errors based on a patch by Niels Thykier, thanks! (Closes: #622805) --- cmdline/apt-cache.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'cmdline/apt-cache.cc') diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc index 01e0d22e0..34f8a1a75 100644 --- a/cmdline/apt-cache.cc +++ b/cmdline/apt-cache.cc @@ -1115,6 +1115,9 @@ bool Dotty(CommandLine &CmdL) } printf("}\n"); + delete[] Show; + delete[] Flags; + delete[] ShapeMap; return true; } /*}}}*/ -- cgit v1.2.3 From 182a6a557492ddbb4320b0c620e19071bd1014c3 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 21 Apr 2011 17:00:37 +0200 Subject: * cmdline/apt-get.cc: - deprecate mostly undocumented 'markauto' in favor of 'apt-mark' * cmdline/apt-cache.cc: - deprecate mostly undocumented 'showauto' in favor of 'apt-mark' --- cmdline/apt-cache.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'cmdline/apt-cache.cc') diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc index 34f8a1a75..f66c22c20 100644 --- a/cmdline/apt-cache.cc +++ b/cmdline/apt-cache.cc @@ -1334,9 +1334,8 @@ bool Search(CommandLine &CmdL) return _error->Error("Write to stdout failed"); return true; } - - -/* show automatically installed packages (sorted) */ + /*}}}*/ +/* ShowAuto - show automatically installed packages (sorted) {{{*/ bool ShowAuto(CommandLine &CmdL) { pkgCacheFile CacheFile; @@ -1357,6 +1356,7 @@ bool ShowAuto(CommandLine &CmdL) for (vector::iterator I = packages.begin(); I != packages.end(); I++) cout << *I << "\n"; + _error->Notice(_("This command is deprecated. Please use 'apt-mark showauto' instead.")); return true; } /*}}}*/ @@ -1702,7 +1702,6 @@ bool ShowHelp(CommandLine &Cmd) " unmet - Show unmet dependencies\n" " search - Search the package list for a regex pattern\n" " show - Show a readable record for the package\n" - " showauto - Display a list of automatically installed packages\n" " depends - Show raw dependency information for a package\n" " rdepends - Show reverse dependency information for a package\n" " pkgnames - List the names of all packages in the system\n" -- cgit v1.2.3 From 359e46db58b85497fd232fbe912b8a62e77079c5 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 11 May 2011 16:05:30 +0200 Subject: convert a lot of places to use IsNegative instead of checking by hand for the three different dependencies --- cmdline/apt-cache.cc | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'cmdline/apt-cache.cc') 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; -- cgit v1.2.3