diff options
author | Arch Librarian <arch@canonical.com> | 2004-09-20 17:04:11 +0000 |
---|---|---|
committer | Arch Librarian <arch@canonical.com> | 2004-09-20 17:04:11 +0000 |
commit | 97f06efd6b988ee5eda18ff40ab71ab063d2fe64 (patch) | |
tree | 583351bb9070b81718e59a5895a6eadda12bdc94 /cmdline/apt-get.cc | |
parent | 50a577284663892595af1477eeea0e92712228ef (diff) |
* Clean up and simplify some of the suggests/recommends...
Author: mdz
Date: 2003-12-20 23:55:05 GMT
* Clean up and simplify some of the suggests/recommends display in apt-get
Diffstat (limited to 'cmdline/apt-get.cc')
-rw-r--r-- | cmdline/apt-get.cc | 34 |
1 files changed, 10 insertions, 24 deletions
diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 315352cbf..a255270c6 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: apt-get.cc,v 1.147 2003/12/20 23:39:54 mdz Exp $ +// $Id: apt-get.cc,v 1.148 2003/12/20 23:55:05 mdz Exp $ /* ###################################################################### apt-get - Cover for dpkg @@ -1557,36 +1557,22 @@ bool DoInstall(CommandLine &CmdL) do { - if (Start->Type == pkgCache::Dep::Suggests) { + /* Skip if package is installed already, or is about to be */ + string target = string(Start.TargetPkg().Name()) + " "; + if ((*Start.TargetPkg()).SelectedState == pkgCache::State::Install + || Cache[Start.TargetPkg()].Install()) + break; - /* A suggests relations, let's see if we have it - installed already */ + /* Skip if we already saw it */ + if (int(SuggestsList.find(target)) != -1 || int(RecommendsList.find(target) != -1) + break; - string target = string(Start.TargetPkg().Name()) + " "; - if ((*Start.TargetPkg()).SelectedState == pkgCache::State::Install || Cache[Start.TargetPkg()].Install()) - break; - /* Does another package suggest it as well? If so, - don't print it twice */ - if (int(SuggestsList.find(target)) > -1) - break; + if (Start->Type == pkgCache::Dep::Suggests) { SuggestsList += target; SuggestsVersions += string(Cache[Start.TargetPkg()].CandVersion) + "\n"; } if (Start->Type == pkgCache::Dep::Recommends) { - - /* A recommends relation, let's see if we have it - installed already */ - - string target = string(Start.TargetPkg().Name()) + " "; - if ((*Start.TargetPkg()).SelectedState == pkgCache::State::Install || Cache[Start.TargetPkg()].Install()) - break; - - /* Does another package recommend it as well? If so, - don't print it twice */ - - if (int(RecommendsList.find(target)) > -1) - break; RecommendsList += target; RecommendsVersions += string(Cache[Start.TargetPkg()].CandVersion) + "\n"; } |