1 // -*- mode: cpp; mode: fold -*-
3 // $Id: orderlist.cc,v 1.4 1999/07/03 03:10:35 jgg Exp $
4 /* ######################################################################
6 Order List - Represents and Manipulates an ordered list of packages.
8 A list of packages can be ordered by a number of conflicting criteria
9 each given a specific priority. Each package also has a set of flags
10 indicating some usefull things about it that are derived in the
11 course of sorting. The pkgPackageManager class uses this class for
12 all of it's installation ordering needs.
14 This is a modified version of Manoj's Routine B. It consists of four
15 independent ordering algorithms that can be applied at for different
16 points in the ordering. By appling progressivly fewer ordering
17 operations it is possible to give each consideration it's own
18 priority and create an order that satisfies the lowest applicable
21 The rules for unpacking ordering are:
22 1) Unpacking ignores Depends: on all packages
23 2) Unpacking requires Conflicts: on -ALL- packages to be satisfied
24 3) Unpacking requires PreDepends: on this package only to be satisfied
25 4) Removing requires that no packages depend on the package to be
28 And the rule for configuration ordering is:
29 1) Configuring requires that the Depends: of the package be satisfied
30 Conflicts+PreDepends are ignored because unpacking says they are
31 already correct [exageration, it does check but we need not be
34 And some features that are valuable for unpacking ordering.
35 f1) Unpacking a new package should advoid breaking dependencies of
37 f2) Removal should not require a force, corrolory of f1
38 f3) Unpacking should order by depends rather than fall back to random
41 Each of the features can be enabled in the sorting routine at an
42 arbitary priority to give quite abit of control over the final unpacking
45 The rules listed above may never be violated and are called Critical.
46 When a critical rule is violated then a loop condition is recorded
47 and will have to be delt with in the caller.
49 ##################################################################### */
51 // Include Files /*{{{*/
53 #pragma implementation "apt-pkg/orderlist.h"
55 #include <apt-pkg/orderlist.h>
56 #include <apt-pkg/depcache.h>
57 #include <apt-pkg/error.h>
58 #include <apt-pkg/version.h>
61 pkgOrderList
*pkgOrderList::Me
= 0;
63 // OrderList::pkgOrderList - Constructor /*{{{*/
64 // ---------------------------------------------------------------------
66 pkgOrderList::pkgOrderList(pkgDepCache
&Cache
) : Cache(Cache
)
75 /* Construct the arrays, egcs 1.0.1 bug requires the package count
77 unsigned long Size
= Cache
.HeaderP
->PackageCount
;
78 Flags
= new unsigned char[Size
];
79 End
= List
= new Package
*[Size
];
80 memset(Flags
,0,sizeof(*Flags
)*Size
);
83 // OrderList::~pkgOrderList - Destructor /*{{{*/
84 // ---------------------------------------------------------------------
86 pkgOrderList::~pkgOrderList()
93 // OrderList::DoRun - Does an order run /*{{{*/
94 // ---------------------------------------------------------------------
95 /* The caller is expeted to have setup the desired probe state */
96 bool pkgOrderList::DoRun()
99 unsigned long Size
= Cache
.HeaderP
->PackageCount
;
100 Package
**NList
= new Package
*[Size
];
103 WipeFlags(Added
| AddPending
| Loop
| InList
);
105 for (iterator I
= List
; I
!= End
; I
++)
108 // Rebuild the main list into the temp list.
109 iterator OldEnd
= End
;
111 for (iterator I
= List
; I
!= OldEnd
; I
++)
112 if (VisitNode(PkgIterator(Cache
,*I
)) == false)
119 // Swap the main list to the new list
125 // OrderList::OrderCritical - Perform critical unpacking ordering /*{{{*/
126 // ---------------------------------------------------------------------
127 /* This performs predepends and immediate configuration ordering only.
128 This is termed critical unpacking ordering. Any loops that form are
129 fatal and indicate that the packages cannot be installed. */
130 bool pkgOrderList::OrderCritical()
134 Primary
= &DepUnPackPre
;
142 qsort(List
,End
- List
,sizeof(*List
),&OrderCompareB
);
144 if (DoRun() == false)
148 return _error
->Error("Fatal, predepends looping detected");
152 // OrderList::OrderUnpack - Perform complete unpacking ordering /*{{{*/
153 // ---------------------------------------------------------------------
154 /* This performs complete unpacking ordering and creates an order that is
155 suitable for unpacking */
156 bool pkgOrderList::OrderUnpack(string
*FileList
)
158 this->FileList
= FileList
;
160 Primary
= &DepUnPackCrit
;
161 Secondary
= &DepConfigure
;
162 RevDepends
= &DepUnPackDep
;
168 qsort(List
,End
- List
,sizeof(*List
),&OrderCompareA
);
170 if (DoRun() == false)
174 if (DoRun() == false)
179 Remove
= 0; // Otherwise the libreadline remove problem occures
180 if (DoRun() == false)
184 Primary
= &DepUnPackPre
;
185 if (DoRun() == false)
188 /* cout << "----------END" << endl;
190 for (iterator I = List; I != End; I++)
192 PkgIterator P(Cache,*I);
193 cout << P.Name() << endl;
199 // OrderList::OrderConfigure - Perform configuration ordering /*{{{*/
200 // ---------------------------------------------------------------------
201 /* This orders by depends only and produces an order which is suitable
203 bool pkgOrderList::OrderConfigure()
206 Primary
= &DepConfigure
;
215 // OrderList::Score - Score the package for sorting /*{{{*/
216 // ---------------------------------------------------------------------
217 /* Higher scores order earlier */
218 int pkgOrderList::Score(PkgIterator Pkg
)
220 // Removal is always done first
221 if (Cache
[Pkg
].Delete() == true)
224 // This should never happen..
225 if (Cache
[Pkg
].InstVerIter(Cache
).end() == true)
229 if ((Pkg
->Flags
& pkgCache::Flag::Essential
) == pkgCache::Flag::Essential
)
232 for (DepIterator D
= Cache
[Pkg
].InstVerIter(Cache
).DependsList();
233 D
.end() == false; D
++)
234 if (D
->Type
== pkgCache::Dep::PreDepends
)
240 // Important Required Standard Optional Extra
241 signed short PrioMap
[] = {0,5,4,3,1,0};
242 if (Cache
[Pkg
].InstVerIter(Cache
)->Priority
<= 5)
243 Score
+= PrioMap
[Cache
[Pkg
].InstVerIter(Cache
)->Priority
];
247 // OrderList::FileCmp - Compare by package file /*{{{*/
248 // ---------------------------------------------------------------------
249 /* This compares by the package file that the install version is in. */
250 int pkgOrderList::FileCmp(PkgIterator A
,PkgIterator B
)
252 if (Cache
[A
].Delete() == true && Cache
[B
].Delete() == true)
254 if (Cache
[A
].Delete() == true)
256 if (Cache
[B
].Delete() == true)
259 if (Cache
[A
].InstVerIter(Cache
).FileList().end() == true)
261 if (Cache
[B
].InstVerIter(Cache
).FileList().end() == true)
264 pkgCache::PackageFile
*FA
= Cache
[A
].InstVerIter(Cache
).FileList().File();
265 pkgCache::PackageFile
*FB
= Cache
[B
].InstVerIter(Cache
).FileList().File();
273 // BoolCompare - Comparison function for two booleans /*{{{*/
274 // ---------------------------------------------------------------------
276 static int BoolCompare(bool A
,bool B
)
285 // OrderList::OrderCompareA - Order the installation by op /*{{{*/
286 // ---------------------------------------------------------------------
287 /* This provides a first-pass sort of the list and gives a decent starting
288 point for further complete ordering. It is used by OrderUnpack only */
289 int pkgOrderList::OrderCompareA(const void *a
, const void *b
)
291 PkgIterator
A(Me
->Cache
,*(Package
**)a
);
292 PkgIterator
B(Me
->Cache
,*(Package
**)b
);
294 // We order packages with a set state toward the front
296 if ((Res
= BoolCompare(Me
->IsNow(A
),Me
->IsNow(B
))) == 0)
299 // We order missing files to toward the end
300 if (Me
->FileList
!= 0)
302 if ((Res
= BoolCompare(Me
->FileList
[A
->ID
].empty() && !Me
->Cache
[A
].Delete(),
303 Me
->FileList
[B
->ID
].empty() && !Me
->Cache
[B
].Delete())) == 0)
307 if (A
.State() != pkgCache::PkgIterator::NeedsNothing
&&
308 B
.State() == pkgCache::PkgIterator::NeedsNothing
)
311 if (A
.State() == pkgCache::PkgIterator::NeedsNothing
&&
312 B
.State() != pkgCache::PkgIterator::NeedsNothing
)
315 int ScoreA
= Me
->Score(A
);
316 int ScoreB
= Me
->Score(B
);
323 return strcmp(A
.Name(),B
.Name());
326 // OrderList::OrderCompareB - Order the installation by source /*{{{*/
327 // ---------------------------------------------------------------------
328 /* This orders by installation source. This is usefull to handle
329 inter-source breaks */
330 int pkgOrderList::OrderCompareB(const void *a
, const void *b
)
332 PkgIterator
A(Me
->Cache
,*(Package
**)a
);
333 PkgIterator
B(Me
->Cache
,*(Package
**)b
);
335 if (A
.State() != pkgCache::PkgIterator::NeedsNothing
&&
336 B
.State() == pkgCache::PkgIterator::NeedsNothing
)
339 if (A
.State() == pkgCache::PkgIterator::NeedsNothing
&&
340 B
.State() != pkgCache::PkgIterator::NeedsNothing
)
343 int F
= Me
->FileCmp(A
,B
);
351 int ScoreA
= Me
->Score(A
);
352 int ScoreB
= Me
->Score(B
);
359 return strcmp(A
.Name(),B
.Name());
363 // OrderList::VisitDeps - Visit forward install dependencies /*{{{*/
364 // ---------------------------------------------------------------------
365 /* This calls the dependency function for the normal forwards dependencies
367 bool pkgOrderList::VisitDeps(DepFunc F
,PkgIterator Pkg
)
369 if (F
== 0 || Pkg
.end() == true || Cache
[Pkg
].InstallVer
== 0)
372 return (this->*F
)(Cache
[Pkg
].InstVerIter(Cache
).DependsList());
375 // OrderList::VisitRDeps - Visit reverse dependencies /*{{{*/
376 // ---------------------------------------------------------------------
377 /* This calls the dependency function for all of the normal reverse depends
379 bool pkgOrderList::VisitRDeps(DepFunc F
,PkgIterator Pkg
)
381 if (F
== 0 || Pkg
.end() == true)
384 return (this->*F
)(Pkg
.RevDependsList());
387 // OrderList::VisitRProvides - Visit provides reverse dependencies /*{{{*/
388 // ---------------------------------------------------------------------
389 /* This calls the dependency function for all reverse dependencies
390 generated by the provides line on the package. */
391 bool pkgOrderList::VisitRProvides(DepFunc F
,VerIterator Ver
)
393 if (F
== 0 || Ver
.end() == true)
397 for (PrvIterator P
= Ver
.ProvidesList(); P
.end() == false; P
++)
398 Res
&= (this->*F
)(P
.ParentPkg().RevDependsList());
402 // OrderList::VisitProvides - Visit all of the providing packages /*{{{*/
403 // ---------------------------------------------------------------------
404 /* This routine calls visit on all providing packages. */
405 bool pkgOrderList::VisitProvides(DepIterator D
)
407 Version
**List
= D
.AllTargets();
408 for (Version
**I
= List
; *I
!= 0; I
++)
410 VerIterator
Ver(Cache
,*I
);
411 PkgIterator Pkg
= Ver
.ParentPkg();
413 if (Cache
[Pkg
].Keep() == true)
416 if (D
->Type
!= pkgCache::Dep::Conflicts
&& Cache
[Pkg
].InstallVer
!= *I
)
419 if (D
->Type
== pkgCache::Dep::Conflicts
&& (Version
*)Pkg
.CurrentVer() != *I
)
422 if (VisitNode(Pkg
) == false)
432 // OrderList::VisitNode - Recursive ordering director /*{{{*/
433 // ---------------------------------------------------------------------
434 /* This is the core ordering routine. It calls the set dependency
435 consideration functions which then potentialy call this again. Finite
436 depth is achived through the colouring mechinism. */
437 bool pkgOrderList::VisitNode(PkgIterator Pkg
)
439 // Looping or irrelevent.
440 // This should probably trancend not installed packages
441 if (Pkg
.end() == true || IsFlag(Pkg
,Added
) == true ||
442 IsFlag(Pkg
,AddPending
) == true || IsFlag(Pkg
,InList
) == false)
445 /* for (int j = 0; j != Depth; j++) cout << ' ';
446 cout << "Visit " << Pkg.Name() << endl;*/
450 Flag(Pkg
,AddPending
);
452 DepFunc Old
= Primary
;
454 // Perform immedate configuration of the package if so flagged.
455 if (IsFlag(Pkg
,Immediate
) == true && Primary
!= &DepUnPackPre
)
456 Primary
= &DepUnPackPreD
;
458 if (IsNow(Pkg
) == true)
461 if (Cache
[Pkg
].Delete() == false)
464 Res
&= Res
&& VisitDeps(Primary
,Pkg
);
465 Res
&= Res
&& VisitRDeps(Primary
,Pkg
);
466 Res
&= Res
&& VisitRProvides(Primary
,Pkg
.CurrentVer());
467 Res
&= Res
&& VisitRProvides(Primary
,Cache
[Pkg
].InstVerIter(Cache
));
470 Res
&= Res
&& VisitRDeps(RevDepends
,Pkg
);
471 Res
&= Res
&& VisitRProvides(RevDepends
,Pkg
.CurrentVer());
472 Res
&= Res
&& VisitRProvides(RevDepends
,Cache
[Pkg
].InstVerIter(Cache
));
475 Res
&= Res
&& VisitDeps(Secondary
,Pkg
);
476 Res
&= Res
&& VisitRDeps(Secondary
,Pkg
);
477 Res
&= Res
&& VisitRProvides(Secondary
,Pkg
.CurrentVer());
478 Res
&= Res
&& VisitRProvides(Secondary
,Cache
[Pkg
].InstVerIter(Cache
));
483 Res
&= Res
&& VisitRDeps(Remove
,Pkg
);
484 Res
&= Res
&& VisitRProvides(Remove
,Pkg
.CurrentVer());
488 if (IsFlag(Pkg
,Added
) == false)
490 Flag(Pkg
,Added
,Added
| AddPending
);
498 /* for (int j = 0; j != Depth; j++) cout << ' ';
499 cout << "Leave " << Pkg.Name() << ' ' << IsFlag(Pkg,Added) << ',' << IsFlag(Pkg,AddPending) << endl;*/
505 // OrderList::DepUnPackCrit - Critical UnPacking ordering /*{{{*/
506 // ---------------------------------------------------------------------
507 /* Critical unpacking ordering strives to satisfy Conflicts: and
508 PreDepends: only. When a prdepends is encountered the Primary
509 DepFunc is changed to be DepUnPackPreD.
511 Loops are preprocessed and logged. */
512 bool pkgOrderList::DepUnPackCrit(DepIterator D
)
514 for (; D
.end() == false; D
++)
516 if (D
.Reverse() == true)
518 /* Reverse depenanices are only interested in conflicts,
519 predepend breakage is ignored here */
520 if (D
->Type
!= pkgCache::Dep::Conflicts
)
523 // Duplication elimination, consider only the current version
524 if (D
.ParentPkg().CurrentVer() != D
.ParentVer())
527 /* For reverse dependencies we wish to check if the
528 dependency is satisifed in the install state. The
529 target package (caller) is going to be in the installed
531 if (CheckDep(D
) == true)
534 if (VisitNode(D
.ParentPkg()) == false)
539 /* Forward critical dependencies MUST be correct before the
540 package can be unpacked. */
541 if (D
->Type
!= pkgCache::Dep::Conflicts
&& D
->Type
!= pkgCache::Dep::PreDepends
)
544 /* We wish to check if the dep is okay in the now state of the
545 target package against the install state of this package. */
546 if (CheckDep(D
) == true)
548 /* We want to catch predepends loops with the code below.
549 Conflicts loops that are Dep OK are ignored */
550 if (IsFlag(D
.TargetPkg(),AddPending
) == false ||
551 D
->Type
!= pkgCache::Dep::PreDepends
)
555 // This is the loop detection
556 if (IsFlag(D
.TargetPkg(),Added
) == true ||
557 IsFlag(D
.TargetPkg(),AddPending
) == true)
559 if (IsFlag(D
.TargetPkg(),AddPending
) == true)
564 /* Predepends require a special ordering stage, they must have
565 all dependents installed as well */
566 DepFunc Old
= Primary
;
568 if (D
->Type
== pkgCache::Dep::PreDepends
)
569 Primary
= &DepUnPackPreD
;
570 Res
= VisitProvides(D
);
579 // OrderList::DepUnPackPreD - Critical UnPacking ordering with depends /*{{{*/
580 // ---------------------------------------------------------------------
581 /* Critical PreDepends (also configure immediate and essential) strives to
582 ensure not only that all conflicts+predepends are met but that this
583 package will be immediately configurable when it is unpacked.
585 Loops are preprocessed and logged. */
586 bool pkgOrderList::DepUnPackPreD(DepIterator D
)
588 if (D
.Reverse() == true)
589 return DepUnPackCrit(D
);
591 for (; D
.end() == false; D
++)
593 if (D
.IsCritical() == false)
596 /* We wish to check if the dep is okay in the now state of the
597 target package against the install state of this package. */
598 if (CheckDep(D
) == true)
600 /* We want to catch predepends loops with the code below.
601 Conflicts loops that are Dep OK are ignored */
602 if (IsFlag(D
.TargetPkg(),AddPending
) == false ||
603 D
->Type
!= pkgCache::Dep::PreDepends
)
607 // This is the loop detection
608 if (IsFlag(D
.TargetPkg(),Added
) == true ||
609 IsFlag(D
.TargetPkg(),AddPending
) == true)
611 if (IsFlag(D
.TargetPkg(),AddPending
) == true)
616 if (VisitProvides(D
) == false)
622 // OrderList::DepUnPackPre - Critical Predepends ordering /*{{{*/
623 // ---------------------------------------------------------------------
624 /* Critical PreDepends (also configure immediate and essential) strives to
625 ensure not only that all conflicts+predepends are met but that this
626 package will be immediately configurable when it is unpacked.
628 Loops are preprocessed and logged. All loops will be fatal. */
629 bool pkgOrderList::DepUnPackPre(DepIterator D
)
631 if (D
.Reverse() == true)
634 for (; D
.end() == false; D
++)
636 /* Only consider the PreDepends or Depends. Depends are only
637 considered at the lowest depth or in the case of immediate
639 if (D
->Type
!= pkgCache::Dep::PreDepends
)
641 if (D
->Type
== pkgCache::Dep::Depends
)
643 if (Depth
== 1 && IsFlag(D
.ParentPkg(),Immediate
) == false)
650 /* We wish to check if the dep is okay in the now state of the
651 target package against the install state of this package. */
652 if (CheckDep(D
) == true)
654 /* We want to catch predepends loops with the code below.
655 Conflicts loops that are Dep OK are ignored */
656 if (IsFlag(D
.TargetPkg(),AddPending
) == false)
660 // This is the loop detection
661 if (IsFlag(D
.TargetPkg(),Added
) == true ||
662 IsFlag(D
.TargetPkg(),AddPending
) == true)
664 if (IsFlag(D
.TargetPkg(),AddPending
) == true)
669 if (VisitProvides(D
) == false)
675 // OrderList::DepUnPackDep - Reverse dependency considerations /*{{{*/
676 // ---------------------------------------------------------------------
677 /* Reverse dependencies are considered to determine if unpacking this
678 package will break any existing dependencies. If so then those
679 packages are ordered before this one so that they are in the
682 The forwards depends loop is designed to bring the packages dependents
683 close to the package. This helps reduce deconfigure time.
685 Loops are irrelevent to this. */
686 bool pkgOrderList::DepUnPackDep(DepIterator D
)
689 for (; D
.end() == false; D
++)
690 if (D
.IsCritical() == true)
692 if (D
.Reverse() == true)
694 /* Duplication prevention. We consider rev deps only on
695 the current version, a not installed package
697 if (D
.ParentPkg()->CurrentVer
== 0 ||
698 D
.ParentPkg().CurrentVer() != D
.ParentVer())
701 // The dep will not break so it is irrelevent.
702 if (CheckDep(D
) == true)
705 if (VisitNode(D
.ParentPkg()) == false)
709 if (D
->Type
== pkgCache::Dep::Depends
)
710 if (VisitProvides(D
) == false)
716 // OrderList::DepConfigure - Configuration ordering /*{{{*/
717 // ---------------------------------------------------------------------
718 /* Configuration only ordering orders by the Depends: line only. It
719 orders configuration so that when a package comes to be configured it's
720 dependents are configured.
722 Loops are ingored. Depends loop entry points are chaotic. */
723 bool pkgOrderList::DepConfigure(DepIterator D
)
725 // Never consider reverse configuration dependencies.
726 if (D
.Reverse() == true)
729 for (; D
.end() == false; D
++)
730 if (D
->Type
== pkgCache::Dep::Depends
)
731 if (VisitProvides(D
) == false)
736 // OrderList::DepRemove - Removal ordering /*{{{*/
737 // ---------------------------------------------------------------------
738 /* Removal visits all reverse depends. It considers if the dependency
739 of the Now state version to see if it is okay with removing this
740 package. This check should always fail, but is provided for symetery
741 with the other critical handlers.
743 Loops are preprocessed and logged. Removal loops can also be
744 detected in the critical handler. They are characterized by an
745 old version of A depending on B but the new version of A conflicting
746 with B, thus either A or B must break to install. */
747 bool pkgOrderList::DepRemove(DepIterator D
)
749 if (D
.Reverse() == false)
751 for (; D
.end() == false; D
++)
752 if (D
->Type
== pkgCache::Dep::Depends
|| D
->Type
== pkgCache::Dep::PreDepends
)
754 // Duplication elimination, consider the current version only
755 if (D
.ParentPkg().CurrentVer() != D
.ParentVer())
758 /* We wish to see if the dep on the parent package is okay
759 in the removed (install) state of the target pkg. */
760 if (CheckDep(D
) == true)
762 // We want to catch loops with the code below.
763 if (IsFlag(D
.ParentPkg(),AddPending
) == false)
767 // This is the loop detection
768 if (IsFlag(D
.ParentPkg(),Added
) == true ||
769 IsFlag(D
.ParentPkg(),AddPending
) == true)
771 if (IsFlag(D
.ParentPkg(),AddPending
) == true)
776 if (VisitNode(D
.ParentPkg()) == false)
784 // OrderList::AddLoop - Add a loop to the loop list /*{{{*/
785 // ---------------------------------------------------------------------
786 /* We record the loops. This is a relic since loop breaking is done
787 genericaly as part of the safety routines. */
788 bool pkgOrderList::AddLoop(DepIterator D
)
790 if (LoopCount
< 0 || LoopCount
>= 20)
796 if (Loops
[LoopCount
- 1].ParentPkg() == D
.ParentPkg() ||
797 Loops
[LoopCount
- 1].TargetPkg() == D
.ParentPkg())
801 Loops
[LoopCount
++] = D
;
803 // Mark the packages as being part of a loop.
804 Flag(D
.TargetPkg(),Loop
);
805 Flag(D
.ParentPkg(),Loop
);
809 // OrderList::WipeFlags - Unset the given flags from all packages /*{{{*/
810 // ---------------------------------------------------------------------
812 void pkgOrderList::WipeFlags(unsigned long F
)
814 unsigned long Size
= Cache
.HeaderP
->PackageCount
;
815 for (unsigned long I
= 0; I
!= Size
; I
++)
819 // OrderList::CheckDep - Check a dependency for truth /*{{{*/
820 // ---------------------------------------------------------------------
821 /* This performs a complete analysis of the dependency wrt to the
822 current add list. It returns true if after all events are
823 performed it is still true. This sort of routine can be approximated
824 by examining the DepCache, however in convoluted cases of provides
825 this fails to produce a suitable result. */
826 bool pkgOrderList::CheckDep(DepIterator D
)
828 Version
**List
= D
.AllTargets();
829 for (Version
**I
= List
; *I
!= 0; I
++)
831 VerIterator
Ver(Cache
,*I
);
832 PkgIterator Pkg
= Ver
.ParentPkg();
834 /* The meaning of Added and AddPending is subtle. AddPending is
835 an indication that the package is looping. Because of the
836 way ordering works Added means the package will be unpacked
837 before this one and AddPending means after. It is therefore
838 correct to ignore AddPending in all cases, but that exposes
839 reverse-ordering loops which should be ignore. */
840 if (IsFlag(Pkg
,Added
) == true ||
841 (IsFlag(Pkg
,AddPending
) == true && D
.Reverse() == true))
843 if (Cache
[Pkg
].InstallVer
!= *I
)
847 if ((Version
*)Pkg
.CurrentVer() != *I
||
848 Pkg
.State() != PkgIterator::NeedsNothing
)
853 /* Conflicts requires that all versions are not present, depends
855 if (D
->Type
!= pkgCache::Dep::Conflicts
)
862 /* Conflicts requires that all versions are not present, depends
864 if (D
->Type
== pkgCache::Dep::Conflicts
)