summaryrefslogtreecommitdiff
path: root/cmdline
diff options
context:
space:
mode:
authorArch Librarian <arch@canonical.com>2004-09-20 17:05:08 +0000
committerArch Librarian <arch@canonical.com>2004-09-20 17:05:08 +0000
commitf2120f3d61c716d5a2489a450ef41db7b49e8d51 (patch)
tree12a339cb883b9af659ad72f2bc97fb0cadf4f036 /cmdline
parentefef4fd3412a2993f74ecc65d423fb6ab35c6145 (diff)
Clean up some indentation, etc. in the suggest/recommen...
Author: mdz Date: 2004-01-26 18:10:57 GMT Clean up some indentation, etc. in the suggest/recommends code
Diffstat (limited to 'cmdline')
-rw-r--r--cmdline/apt-get.cc33
1 files changed, 19 insertions, 14 deletions
diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc
index 3ac21347f..c36bac1a5 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.152 2004/01/09 07:32:39 mdz Exp $
+// $Id: apt-get.cc,v 1.153 2004/01/26 18:10:57 mdz Exp $
/* ######################################################################
apt-get - Cover for dpkg
@@ -1532,9 +1532,9 @@ bool DoInstall(CommandLine &CmdL)
continue;
for (pkgCache::VerIterator V = I.VersionList(); V.end() == false; V++)
- {
+ {
for (pkgCache::DepIterator D = V.DependsList(); D.end() == false; D++)
- {
+ {
pkgCache::DepIterator Start;
pkgCache::DepIterator End;
D.GlobOr(Start,End);
@@ -1544,20 +1544,24 @@ bool DoInstall(CommandLine &CmdL)
* packages that provide it and see if any of those are
* installed
*/
- pkgCache::PrvIterator Prv = Start.TargetPkg().ProvidesList();
+
bool providedBySomething = false;
- for (; Prv.end() != true; Prv++)
- if ((*Cache)[Prv.OwnerPkg()].InstVerIter(*Cache).end() == false) {
+ for (pkgCache::PrvIterator Prv = Start.TargetPkg().ProvidesList();
+ Prv.end() != true;
+ Prv++)
+ if ((*Cache)[Prv.OwnerPkg()].InstVerIter(*Cache).end() == false)
+ {
providedBySomething = true;
break;
}
if (providedBySomething) continue;
- do
- {
+ for(;;)
+ {
/* 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;
@@ -1575,12 +1579,13 @@ bool DoInstall(CommandLine &CmdL)
RecommendsList += target;
RecommendsVersions += string(Cache[Start.TargetPkg()].CandVersion) + "\n";
}
- if (Start == End)
- break;
- Start++;
- } while (1);
- }
- }
+
+ if (Start >= End)
+ break;
+ Start++;
+ }
+ }
+ }
}
ShowList(c1out,_("Suggested packages:"),SuggestsList,SuggestsVersions);
ShowList(c1out,_("Recommended packages:"),RecommendsList,RecommendsVersions);