G++3 fixes from Randolph
[ntk/apt.git] / apt-pkg / packagemanager.cc
CommitLineData
6c139d6e
AL
1// -*- mode: cpp; mode: fold -*-
2// Description /*{{{*/
5819a761 3// $Id: packagemanager.cc,v 1.27 2001/05/07 05:49:43 jgg Exp $
6c139d6e
AL
4/* ######################################################################
5
6 Package Manager - Abstacts the package manager
7
8 More work is needed in the area of transitioning provides, ie exim
9 replacing smail. This can cause interesing side effects.
10
11 Other cases involving conflicts+replaces should be tested.
12
13 ##################################################################### */
14 /*}}}*/
15// Include Files /*{{{*/
16#ifdef __GNUG__
094a497d 17#pragma implementation "apt-pkg/packagemanager.h"
6c139d6e 18#endif
b2e465d6 19
094a497d
AL
20#include <apt-pkg/packagemanager.h>
21#include <apt-pkg/orderlist.h>
22#include <apt-pkg/depcache.h>
23#include <apt-pkg/error.h>
24#include <apt-pkg/version.h>
03e39e59 25#include <apt-pkg/acquire-item.h>
30e1eab5
AL
26#include <apt-pkg/algorithms.h>
27#include <apt-pkg/configuration.h>
b2e465d6
AL
28#include <apt-pkg/sptr.h>
29
30#include <apti18n.h>
5819a761 31#include <iostream>
6c139d6e
AL
32 /*}}}*/
33
5819a761
AL
34using namespace std;
35
6c139d6e
AL
36// PM::PackageManager - Constructor /*{{{*/
37// ---------------------------------------------------------------------
38/* */
b2e465d6 39pkgPackageManager::pkgPackageManager(pkgDepCache *pCache) : Cache(*pCache)
6c139d6e
AL
40{
41 FileNames = new string[Cache.Head().PackageCount];
42 List = 0;
30e1eab5 43 Debug = _config->FindB("Debug::pkgPackageManager",false);
6c139d6e
AL
44}
45 /*}}}*/
46// PM::PackageManager - Destructor /*{{{*/
47// ---------------------------------------------------------------------
48/* */
49pkgPackageManager::~pkgPackageManager()
50{
51 delete List;
52 delete [] FileNames;
53}
54 /*}}}*/
03e39e59
AL
55// PM::GetArchives - Queue the archives for download /*{{{*/
56// ---------------------------------------------------------------------
57/* */
58bool pkgPackageManager::GetArchives(pkgAcquire *Owner,pkgSourceList *Sources,
59 pkgRecords *Recs)
60{
7a1b1f8b
AL
61 if (CreateOrderList() == false)
62 return false;
63
64 if (List->OrderUnpack() == false)
65 return _error->Error("Internal ordering error");
66
67 for (pkgOrderList::iterator I = List->begin(); I != List->end(); I++)
68 {
69 PkgIterator Pkg(Cache,*I);
281daf46
AL
70 FileNames[Pkg->ID] = string();
71
7a1b1f8b
AL
72 // Skip packages to erase
73 if (Cache[Pkg].Delete() == true)
03e39e59 74 continue;
d38b7b3d
AL
75
76 // Skip Packages that need configure only.
9dbb421f
AL
77 if (Pkg.State() == pkgCache::PkgIterator::NeedsConfigure &&
78 Cache[Pkg].Keep() == true)
d38b7b3d 79 continue;
281daf46
AL
80
81 // Skip already processed packages
82 if (List->IsNow(Pkg) == false)
83 continue;
84
7a1b1f8b
AL
85 new pkgAcqArchive(Owner,Sources,Recs,Cache[Pkg].InstVerIter(Cache),
86 FileNames[Pkg->ID]);
03e39e59 87 }
7a1b1f8b 88
03e39e59
AL
89 return true;
90}
91 /*}}}*/
6c139d6e
AL
92// PM::FixMissing - Keep all missing packages /*{{{*/
93// ---------------------------------------------------------------------
94/* This is called to correct the installation when packages could not
95 be downloaded. */
96bool pkgPackageManager::FixMissing()
bdae53f1 97{
b2e465d6 98 pkgProblemResolver Resolve(&Cache);
2fd65468
AL
99 List->SetFileList(FileNames);
100
9dbb421f 101 bool Bad = false;
6c139d6e
AL
102 for (PkgIterator I = Cache.PkgBegin(); I.end() == false; I++)
103 {
2fd65468 104 if (List->IsMissing(I) == false)
9dbb421f 105 continue;
2fd65468 106
9dbb421f
AL
107 // Okay, this file is missing and we need it. Mark it for keep
108 Bad = true;
6c139d6e
AL
109 Cache.MarkKeep(I);
110 }
bdae53f1
AL
111
112 // We have to empty the list otherwise it will not have the new changes
113 delete List;
114 List = 0;
6c139d6e 115
9dbb421f
AL
116 if (Bad == false)
117 return true;
118
6c139d6e 119 // Now downgrade everything that is broken
30e1eab5 120 return Resolve.ResolveByKeep() == true && Cache.BrokenCount() == 0;
6c139d6e
AL
121}
122 /*}}}*/
123
7a1b1f8b
AL
124// PM::CreateOrderList - Create the ordering class /*{{{*/
125// ---------------------------------------------------------------------
126/* This populates the ordering list with all the packages that are
127 going to change. */
128bool pkgPackageManager::CreateOrderList()
129{
281daf46
AL
130 if (List != 0)
131 return true;
132
7a1b1f8b 133 delete List;
b2e465d6 134 List = new pkgOrderList(&Cache);
7a1b1f8b 135
b780bc1b 136 bool NoImmConfigure = _config->FindB("APT::Immediate-Configure",false);
079cc404 137
7a1b1f8b
AL
138 // Generate the list of affected packages and sort it
139 for (PkgIterator I = Cache.PkgBegin(); I.end() == false; I++)
140 {
138d4b3d
AL
141 // Mark the package and its dependends for immediate configuration
142 if (((I->Flags & pkgCache::Flag::Essential) == pkgCache::Flag::Essential ||
143 (I->Flags & pkgCache::Flag::Important) == pkgCache::Flag::Important) &&
079cc404 144 NoImmConfigure == false)
7a1b1f8b
AL
145 {
146 List->Flag(I,pkgOrderList::Immediate);
d38b7b3d
AL
147
148 // Look for other packages to make immediate configurea
7a1b1f8b
AL
149 if (Cache[I].InstallVer != 0)
150 for (DepIterator D = Cache[I].InstVerIter(Cache).DependsList();
151 D.end() == false; D++)
152 if (D->Type == pkgCache::Dep::Depends || D->Type == pkgCache::Dep::PreDepends)
153 List->Flag(D.TargetPkg(),pkgOrderList::Immediate);
d38b7b3d
AL
154
155 // And again with the current version.
7a1b1f8b
AL
156 if (I->CurrentVer != 0)
157 for (DepIterator D = I.CurrentVer().DependsList();
158 D.end() == false; D++)
159 if (D->Type == pkgCache::Dep::Depends || D->Type == pkgCache::Dep::PreDepends)
160 List->Flag(D.TargetPkg(),pkgOrderList::Immediate);
161 }
162
163 // Not interesting
164 if ((Cache[I].Keep() == true ||
165 Cache[I].InstVerIter(Cache) == I.CurrentVer()) &&
d556d1a1 166 I.State() == pkgCache::PkgIterator::NeedsNothing &&
d0c59649 167 (Cache[I].iFlags & pkgDepCache::ReInstall) != pkgDepCache::ReInstall &&
d556d1a1
AL
168 (I.Purge() != false || Cache[I].Mode != pkgDepCache::ModeDelete ||
169 (Cache[I].iFlags & pkgDepCache::Purge) != pkgDepCache::Purge))
7a1b1f8b
AL
170 continue;
171
172 // Append it to the list
138d4b3d 173 List->push_back(I);
7a1b1f8b
AL
174 }
175
176 return true;
177}
178 /*}}}*/
6c139d6e
AL
179// PM::DepAlwaysTrue - Returns true if this dep is irrelevent /*{{{*/
180// ---------------------------------------------------------------------
181/* The restriction on provides is to eliminate the case when provides
182 are transitioning between valid states [ie exim to smail] */
183bool pkgPackageManager::DepAlwaysTrue(DepIterator D)
184{
185 if (D.TargetPkg()->ProvidesList != 0)
186 return false;
187
188 if ((Cache[D] & pkgDepCache::DepInstall) != 0 &&
189 (Cache[D] & pkgDepCache::DepNow) != 0)
190 return true;
191 return false;
192}
193 /*}}}*/
194// PM::CheckRConflicts - Look for reverse conflicts /*{{{*/
195// ---------------------------------------------------------------------
196/* This looks over the reverses for a conflicts line that needs early
197 removal. */
198bool pkgPackageManager::CheckRConflicts(PkgIterator Pkg,DepIterator D,
199 const char *Ver)
200{
201 for (;D.end() == false; D++)
202 {
b2e465d6
AL
203 if (D->Type != pkgCache::Dep::Conflicts &&
204 D->Type != pkgCache::Dep::Obsoletes)
6c139d6e 205 continue;
5af32db6
AL
206
207 // The package hasnt been changed
208 if (List->IsNow(Pkg) == false)
209 continue;
6c139d6e 210
5af32db6
AL
211 // Ignore self conflicts, ignore conflicts from irrelevent versions
212 if (D.ParentPkg() == Pkg || D.ParentVer() != D.ParentPkg().CurrentVer())
6c139d6e
AL
213 continue;
214
b2e465d6 215 if (Cache.VS().CheckDep(Ver,D->CompareOp,D.TargetVer()) == false)
6c139d6e 216 continue;
b2e465d6 217
6c139d6e 218 if (EarlyRemove(D.ParentPkg()) == false)
5af32db6
AL
219 return _error->Error("Reverse conflicts early remove for package '%s' failed",
220 Pkg.Name());
221 }
6c139d6e
AL
222 return true;
223}
224 /*}}}*/
225// PM::ConfigureAll - Run the all out configuration /*{{{*/
226// ---------------------------------------------------------------------
227/* This configures every package. It is assumed they are all unpacked and
228 that the final configuration is valid. */
229bool pkgPackageManager::ConfigureAll()
230{
b2e465d6 231 pkgOrderList OList(&Cache);
6c139d6e
AL
232
233 // Populate the order list
234 for (pkgOrderList::iterator I = List->begin(); I != List->end(); I++)
235 if (List->IsFlag(pkgCache::PkgIterator(Cache,*I),
236 pkgOrderList::UnPacked) == true)
237 OList.push_back(*I);
238
239 if (OList.OrderConfigure() == false)
240 return false;
241
242 // Perform the configuring
243 for (pkgOrderList::iterator I = OList.begin(); I != OList.end(); I++)
244 {
245 PkgIterator Pkg(Cache,*I);
246
247 if (Configure(Pkg) == false)
248 return false;
249
250 List->Flag(Pkg,pkgOrderList::Configured,pkgOrderList::States);
251 }
252
253 return true;
254}
255 /*}}}*/
256// PM::SmartConfigure - Perform immediate configuration of the pkg /*{{{*/
257// ---------------------------------------------------------------------
258/* This routine scheduals the configuration of the given package and all
259 of it's dependents. */
260bool pkgPackageManager::SmartConfigure(PkgIterator Pkg)
261{
b2e465d6 262 pkgOrderList OList(&Cache);
6c139d6e
AL
263
264 if (DepAdd(OList,Pkg) == false)
265 return false;
266
267 if (OList.OrderConfigure() == false)
268 return false;
b2e465d6 269
6c139d6e
AL
270 // Perform the configuring
271 for (pkgOrderList::iterator I = OList.begin(); I != OList.end(); I++)
272 {
273 PkgIterator Pkg(Cache,*I);
274
275 if (Configure(Pkg) == false)
276 return false;
277
278 List->Flag(Pkg,pkgOrderList::Configured,pkgOrderList::States);
279 }
280
281 // Sanity Check
282 if (List->IsFlag(Pkg,pkgOrderList::Configured) == false)
283 return _error->Error("Internal error, could not immediate configure %s",Pkg.Name());
284
285 return true;
286}
287 /*}}}*/
288// PM::DepAdd - Add all dependents to the oder list /*{{{*/
289// ---------------------------------------------------------------------
290/* This recursively adds all dependents to the order list */
291bool pkgPackageManager::DepAdd(pkgOrderList &OList,PkgIterator Pkg,int Depth)
292{
293 if (OList.IsFlag(Pkg,pkgOrderList::Added) == true)
294 return true;
295 if (List->IsFlag(Pkg,pkgOrderList::Configured) == true)
296 return true;
297 if (List->IsFlag(Pkg,pkgOrderList::UnPacked) == false)
298 return false;
b2e465d6 299
6c139d6e
AL
300 // Put the package on the list
301 OList.push_back(Pkg);
302 OList.Flag(Pkg,pkgOrderList::Added);
303 Depth++;
304
305 // Check the dependencies to see if they are all satisfied.
306 bool Bad = false;
307 for (DepIterator D = Cache[Pkg].InstVerIter(Cache).DependsList(); D.end() == false;)
308 {
b50b2c97 309 if (D->Type != pkgCache::Dep::Depends && D->Type != pkgCache::Dep::PreDepends)
6c139d6e
AL
310 {
311 D++;
312 continue;
313 }
314
315 // Grok or groups
316 Bad = true;
317 for (bool LastOR = true; D.end() == false && LastOR == true; D++)
318 {
b50b2c97 319 LastOR = (D->CompareOp & pkgCache::Dep::Or) == pkgCache::Dep::Or;
6c139d6e
AL
320
321 if (Bad == false)
322 continue;
323
b2e465d6 324 SPtrArray<Version *> VList = D.AllTargets();
6c139d6e
AL
325 for (Version **I = VList; *I != 0 && Bad == true; I++)
326 {
327 VerIterator Ver(Cache,*I);
328 PkgIterator Pkg = Ver.ParentPkg();
329
330 // See if the current version is ok
331 if (Pkg.CurrentVer() == Ver && List->IsNow(Pkg) == true &&
332 Pkg.State() == PkgIterator::NeedsNothing)
333 {
334 Bad = false;
335 continue;
336 }
337
338 // Not the install version
339 if (Cache[Pkg].InstallVer != *I ||
340 (Cache[Pkg].Keep() == true && Pkg.State() == PkgIterator::NeedsNothing))
341 continue;
b2e465d6 342
6c139d6e
AL
343 if (List->IsFlag(Pkg,pkgOrderList::UnPacked) == true)
344 Bad = !DepAdd(OList,Pkg,Depth);
345 if (List->IsFlag(Pkg,pkgOrderList::Configured) == true)
346 Bad = false;
347 }
6c139d6e
AL
348 }
349
350 if (Bad == true)
351 {
352 OList.Flag(Pkg,0,pkgOrderList::Added);
353 OList.pop_back();
354 Depth--;
355 return false;
356 }
357 }
358
359 Depth--;
360 return true;
361}
362 /*}}}*/
363// PM::EarlyRemove - Perform removal of packages before their time /*{{{*/
364// ---------------------------------------------------------------------
365/* This is called to deal with conflicts arising from unpacking */
366bool pkgPackageManager::EarlyRemove(PkgIterator Pkg)
367{
368 if (List->IsNow(Pkg) == false)
369 return true;
370
371 // Already removed it
372 if (List->IsFlag(Pkg,pkgOrderList::Removed) == true)
373 return true;
374
375 // Woops, it will not be re-installed!
376 if (List->IsFlag(Pkg,pkgOrderList::InList) == false)
377 return false;
9d4c8f67
AL
378
379 // Essential packages get special treatment
5af32db6 380 bool IsEssential = false;
9d4c8f67 381 if ((Pkg->Flags & pkgCache::Flag::Essential) != 0)
5af32db6
AL
382 IsEssential = true;
383
384 /* Check for packages that are the dependents of essential packages and
385 promote them too */
386 if (Pkg->CurrentVer != 0)
387 {
388 for (DepIterator D = Pkg.RevDependsList(); D.end() == false &&
389 IsEssential == false; D++)
390 if (D->Type == pkgCache::Dep::Depends || D->Type == pkgCache::Dep::PreDepends)
391 if ((D.ParentPkg()->Flags & pkgCache::Flag::Essential) != 0)
392 IsEssential = true;
393 }
394
395 if (IsEssential == true)
9d4c8f67
AL
396 {
397 if (_config->FindB("APT::Force-LoopBreak",false) == false)
b2e465d6
AL
398 return _error->Error(_("This installation run will require temporarily "
399 "removing the essential package %s due to a "
400 "Conflicts/Pre-Depends loop. This is often bad, "
401 "but if you really want to do it, activate the "
402 "APT::Force-LoopBreak option."),Pkg.Name());
9d4c8f67 403 }
6c139d6e
AL
404
405 bool Res = SmartRemove(Pkg);
406 if (Cache[Pkg].Delete() == false)
407 List->Flag(Pkg,pkgOrderList::Removed,pkgOrderList::States);
408
409 return Res;
410}
411 /*}}}*/
412// PM::SmartRemove - Removal Helper /*{{{*/
413// ---------------------------------------------------------------------
414/* */
415bool pkgPackageManager::SmartRemove(PkgIterator Pkg)
416{
417 if (List->IsNow(Pkg) == false)
418 return true;
419
420 List->Flag(Pkg,pkgOrderList::Configured,pkgOrderList::States);
fc4b5c9f 421 return Remove(Pkg,(Cache[Pkg].iFlags & pkgDepCache::Purge) == pkgDepCache::Purge);
6c139d6e
AL
422}
423 /*}}}*/
424// PM::SmartUnPack - Install helper /*{{{*/
425// ---------------------------------------------------------------------
426/* This performs the task of handling pre-depends. */
427bool pkgPackageManager::SmartUnPack(PkgIterator Pkg)
428{
429 // Check if it is already unpacked
430 if (Pkg.State() == pkgCache::PkgIterator::NeedsConfigure &&
431 Cache[Pkg].Keep() == true)
432 {
433 List->Flag(Pkg,pkgOrderList::UnPacked,pkgOrderList::States);
434 if (List->IsFlag(Pkg,pkgOrderList::Immediate) == true)
435 if (SmartConfigure(Pkg) == false)
b2e465d6 436 return _error->Error("Internal Error, Could not perform immediate configuration (1) on %s",Pkg.Name());
6c139d6e
AL
437 return true;
438 }
981d20eb 439
6c139d6e
AL
440 /* See if this packages install version has any predependencies
441 that are not met by 'now' packages. */
442 for (DepIterator D = Cache[Pkg].InstVerIter(Cache).DependsList();
421c8d10 443 D.end() == false; )
6c139d6e 444 {
421c8d10
AL
445 // Compute a single dependency element (glob or)
446 pkgCache::DepIterator Start;
447 pkgCache::DepIterator End;
448 D.GlobOr(Start,End);
449
450 while (End->Type == pkgCache::Dep::PreDepends)
6c139d6e
AL
451 {
452 // Look for possible ok targets.
b2e465d6 453 SPtrArray<Version *> VList = Start.AllTargets();
6c139d6e
AL
454 bool Bad = true;
455 for (Version **I = VList; *I != 0 && Bad == true; I++)
456 {
457 VerIterator Ver(Cache,*I);
458 PkgIterator Pkg = Ver.ParentPkg();
459
460 // See if the current version is ok
461 if (Pkg.CurrentVer() == Ver && List->IsNow(Pkg) == true &&
462 Pkg.State() == PkgIterator::NeedsNothing)
463 {
464 Bad = false;
465 continue;
466 }
467 }
468
469 // Look for something that could be configured.
470 for (Version **I = VList; *I != 0 && Bad == true; I++)
471 {
472 VerIterator Ver(Cache,*I);
473 PkgIterator Pkg = Ver.ParentPkg();
474
475 // Not the install version
476 if (Cache[Pkg].InstallVer != *I ||
477 (Cache[Pkg].Keep() == true && Pkg.State() == PkgIterator::NeedsNothing))
478 continue;
479
480 Bad = !SmartConfigure(Pkg);
481 }
482
421c8d10
AL
483 /* If this or element did not match then continue on to the
484 next or element until a matching element is found*/
485 if (Bad == true)
486 {
487 if (Start == End)
488 return _error->Error("Internal Error, Couldn't configure a pre-depend");
489 Start++;
490 }
491 else
492 break;
6c139d6e
AL
493 }
494
b2e465d6
AL
495 if (End->Type == pkgCache::Dep::Conflicts ||
496 End->Type == pkgCache::Dep::Obsoletes)
6c139d6e
AL
497 {
498 /* Look for conflicts. Two packages that are both in the install
499 state cannot conflict so we don't check.. */
b2e465d6 500 SPtrArray<Version *> VList = End.AllTargets();
6c139d6e
AL
501 for (Version **I = VList; *I != 0; I++)
502 {
503 VerIterator Ver(Cache,*I);
504 PkgIterator Pkg = Ver.ParentPkg();
505
506 // See if the current version is conflicting
507 if (Pkg.CurrentVer() == Ver && List->IsNow(Pkg) == true)
508 {
509 if (EarlyRemove(Pkg) == false)
510 return _error->Error("Internal Error, Could not early remove %s",Pkg.Name());
511 }
512 }
6c139d6e
AL
513 }
514 }
515
516 // Check for reverse conflicts.
5af32db6
AL
517 if (CheckRConflicts(Pkg,Pkg.RevDependsList(),
518 Cache[Pkg].InstVerIter(Cache).VerStr()) == false)
519 return false;
520
6c139d6e
AL
521 for (PrvIterator P = Cache[Pkg].InstVerIter(Cache).ProvidesList();
522 P.end() == false; P++)
523 CheckRConflicts(Pkg,P.ParentPkg().RevDependsList(),P.ProvideVersion());
524
525 if (Install(Pkg,FileNames[Pkg->ID]) == false)
526 return false;
527
528 List->Flag(Pkg,pkgOrderList::UnPacked,pkgOrderList::States);
529
530 // Perform immedate configuration of the package.
531 if (List->IsFlag(Pkg,pkgOrderList::Immediate) == true)
532 if (SmartConfigure(Pkg) == false)
b2e465d6 533 return _error->Error("Internal Error, Could not perform immediate configuration (2) on %s",Pkg.Name());
6c139d6e
AL
534
535 return true;
536}
537 /*}}}*/
538// PM::OrderInstall - Installation ordering routine /*{{{*/
539// ---------------------------------------------------------------------
540/* */
281daf46 541pkgPackageManager::OrderResult pkgPackageManager::OrderInstall()
6c139d6e 542{
7a1b1f8b 543 if (CreateOrderList() == false)
281daf46
AL
544 return Failed;
545
546 Reset();
6c139d6e 547
30e1eab5
AL
548 if (Debug == true)
549 clog << "Begining to order" << endl;
6c139d6e 550
281daf46
AL
551 if (List->OrderUnpack(FileNames) == false)
552 {
553 _error->Error("Internal ordering error");
554 return Failed;
555 }
556
30e1eab5
AL
557 if (Debug == true)
558 clog << "Done ordering" << endl;
559
281daf46 560 bool DoneSomething = false;
6c139d6e
AL
561 for (pkgOrderList::iterator I = List->begin(); I != List->end(); I++)
562 {
563 PkgIterator Pkg(Cache,*I);
281daf46
AL
564
565 if (List->IsNow(Pkg) == false)
566 {
567 if (Debug == true)
568 clog << "Skipping already done " << Pkg.Name() << endl;
569 continue;
570 }
571
2fd65468 572 if (List->IsMissing(Pkg) == true)
281daf46
AL
573 {
574 if (Debug == true)
a3eaf954 575 clog << "Sequence completed at " << Pkg.Name() << endl;
281daf46
AL
576 if (DoneSomething == false)
577 {
578 _error->Error("Internal Error, ordering was unable to handle the media swap");
579 return Failed;
580 }
581 return Incomplete;
582 }
6c139d6e
AL
583
584 // Sanity check
d0c59649
AL
585 if (Cache[Pkg].Keep() == true &&
586 Pkg.State() == pkgCache::PkgIterator::NeedsNothing &&
587 (Cache[Pkg].iFlags & pkgDepCache::ReInstall) != pkgDepCache::ReInstall)
281daf46
AL
588 {
589 _error->Error("Internal Error, trying to manipulate a kept package");
590 return Failed;
591 }
6c139d6e
AL
592
593 // Perform a delete or an install
594 if (Cache[Pkg].Delete() == true)
595 {
596 if (SmartRemove(Pkg) == false)
281daf46 597 return Failed;
6c139d6e
AL
598 }
599 else
600 if (SmartUnPack(Pkg) == false)
281daf46
AL
601 return Failed;
602 DoneSomething = true;
6c139d6e
AL
603 }
604
605 // Final run through the configure phase
606 if (ConfigureAll() == false)
281daf46 607 return Failed;
6c139d6e
AL
608
609 // Sanity check
610 for (pkgOrderList::iterator I = List->begin(); I != List->end(); I++)
281daf46 611 {
6c139d6e 612 if (List->IsFlag(*I,pkgOrderList::Configured) == false)
281daf46
AL
613 {
614 _error->Error("Internal error, packages left unconfigured. %s",
615 PkgIterator(Cache,*I).Name());
616 return Failed;
617 }
618 }
619
620 return Completed;
6c139d6e
AL
621}
622 /*}}}*/
623// PM::DoInstall - Does the installation /*{{{*/
624// ---------------------------------------------------------------------
625/* This uses the filenames in FileNames and the information in the
626 DepCache to perform the installation of packages.*/
281daf46 627pkgPackageManager::OrderResult pkgPackageManager::DoInstall()
6c139d6e 628{
281daf46
AL
629 OrderResult Res = OrderInstall();
630 if (Res != Failed)
631 if (Go() == false)
632 return Failed;
633 return Res;
6c139d6e
AL
634}
635 /*}}}*/