summaryrefslogtreecommitdiff
path: root/cmdline/apt-get.cc
diff options
context:
space:
mode:
Diffstat (limited to 'cmdline/apt-get.cc')
-rw-r--r--cmdline/apt-get.cc34
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";
}