]>
git.saurik.com Git - apt.git/blob - apt-pkg/depcache.cc
1 // -*- mode: cpp; mode: fold -*-
3 // $Id: depcache.cc,v 1.23 2001/02/20 07:03:17 jgg Exp $
4 /* ######################################################################
6 Dependency Cache - Caches Dependency information.
8 ##################################################################### */
10 // Include Files /*{{{*/
12 #pragma implementation "apt-pkg/depcache.h"
14 #include <apt-pkg/depcache.h>
15 #include <apt-pkg/version.h>
16 #include <apt-pkg/error.h>
17 #include <apt-pkg/sptr.h>
18 #include <apt-pkg/algorithms.h>
23 // DepCache::pkgDepCache - Constructors /*{{{*/
24 // ---------------------------------------------------------------------
26 pkgDepCache::pkgDepCache(pkgCache
*pCache
,Policy
*Plcy
) :
27 Cache(pCache
), PkgState(0), DepState(0)
32 delLocalPolicy
= LocalPolicy
= new Policy
;
35 // DepCache::~pkgDepCache - Destructor /*{{{*/
36 // ---------------------------------------------------------------------
38 pkgDepCache::~pkgDepCache()
42 delete delLocalPolicy
;
45 // DepCache::Init - Generate the initial extra structures. /*{{{*/
46 // ---------------------------------------------------------------------
47 /* This allocats the extension buffers and initializes them. */
48 bool pkgDepCache::Init(OpProgress
*Prog
)
52 PkgState
= new StateCache
[Head().PackageCount
];
53 DepState
= new unsigned char[Head().DependsCount
];
54 memset(PkgState
,0,sizeof(*PkgState
)*Head().PackageCount
);
55 memset(DepState
,0,sizeof(*DepState
)*Head().DependsCount
);
59 Prog
->OverallProgress(0,2*Head().PackageCount
,Head().PackageCount
,
60 _("Building Dependency Tree"));
61 Prog
->SubProgress(Head().PackageCount
,_("Candidate Versions"));
64 /* Set the current state of everything. In this state all of the
65 packages are kept exactly as is. See AllUpgrade */
67 for (PkgIterator I
= PkgBegin(); I
.end() != true; I
++,Done
++)
72 // Find the proper cache slot
73 StateCache
&State
= PkgState
[I
->ID
];
76 // Figure out the install version
77 State
.CandidateVer
= GetCandidateVer(I
);
78 State
.InstallVer
= I
.CurrentVer();
79 State
.Mode
= ModeKeep
;
81 State
.Update(I
,*this);
87 Prog
->OverallProgress(Head().PackageCount
,2*Head().PackageCount
,
89 _("Building Dependency Tree"));
90 Prog
->SubProgress(Head().PackageCount
,_("Dependency Generation"));
99 // DepCache::CheckDep - Checks a single dependency /*{{{*/
100 // ---------------------------------------------------------------------
101 /* This first checks the dependency against the main target package and
102 then walks along the package provides list and checks if each provides
103 will be installed then checks the provides against the dep. Res will be
104 set to the package which was used to satisfy the dep. */
105 bool pkgDepCache::CheckDep(DepIterator Dep
,int Type
,PkgIterator
&Res
)
107 Res
= Dep
.TargetPkg();
109 /* Check simple depends. A depends -should- never self match but
110 we allow it anyhow because dpkg does. Technically it is a packaging
111 bug. Conflicts may never self match */
112 if (Dep
.TargetPkg() != Dep
.ParentPkg() ||
113 (Dep
->Type
!= Dep::Conflicts
&& Dep
->Type
!= Dep::Obsoletes
))
115 PkgIterator Pkg
= Dep
.TargetPkg();
116 // Check the base package
117 if (Type
== NowVersion
&& Pkg
->CurrentVer
!= 0)
118 if (VS().CheckDep(Pkg
.CurrentVer().VerStr(),Dep
->CompareOp
,
119 Dep
.TargetVer()) == true)
122 if (Type
== InstallVersion
&& PkgState
[Pkg
->ID
].InstallVer
!= 0)
123 if (VS().CheckDep(PkgState
[Pkg
->ID
].InstVerIter(*this).VerStr(),
124 Dep
->CompareOp
,Dep
.TargetVer()) == true)
127 if (Type
== CandidateVersion
&& PkgState
[Pkg
->ID
].CandidateVer
!= 0)
128 if (VS().CheckDep(PkgState
[Pkg
->ID
].CandidateVerIter(*this).VerStr(),
129 Dep
->CompareOp
,Dep
.TargetVer()) == true)
133 if (Dep
->Type
== Dep::Obsoletes
)
136 // Check the providing packages
137 PrvIterator P
= Dep
.TargetPkg().ProvidesList();
138 PkgIterator Pkg
= Dep
.ParentPkg();
139 for (; P
.end() != true; P
++)
141 /* Provides may never be applied against the same package if it is
142 a conflicts. See the comment above. */
143 if (P
.OwnerPkg() == Pkg
&& Dep
->Type
== Dep::Conflicts
)
146 // Check if the provides is a hit
147 if (Type
== NowVersion
)
149 if (P
.OwnerPkg().CurrentVer() != P
.OwnerVer())
153 if (Type
== InstallVersion
)
155 StateCache
&State
= PkgState
[P
.OwnerPkg()->ID
];
156 if (State
.InstallVer
!= (Version
*)P
.OwnerVer())
160 if (Type
== CandidateVersion
)
162 StateCache
&State
= PkgState
[P
.OwnerPkg()->ID
];
163 if (State
.CandidateVer
!= (Version
*)P
.OwnerVer())
167 // Compare the versions.
168 if (VS().CheckDep(P
.ProvideVersion(),Dep
->CompareOp
,Dep
.TargetVer()) == true)
178 // DepCache::AddSizes - Add the packages sizes to the counters /*{{{*/
179 // ---------------------------------------------------------------------
180 /* Call with Mult = -1 to preform the inverse opration */
181 void pkgDepCache::AddSizes(const PkgIterator
&Pkg
,signed long Mult
)
183 StateCache
&P
= PkgState
[Pkg
->ID
];
185 if (Pkg
.State() == pkgCache::PkgIterator::NeedsConfigure
&&
189 // Compute the size data
190 if (P
.NewInstall() == true)
192 iUsrSize
+= (signed)(Mult
*P
.InstVerIter(*this)->InstalledSize
);
193 iDownloadSize
+= (signed)(Mult
*P
.InstVerIter(*this)->Size
);
198 if (Pkg
->CurrentVer
!= 0 &&
199 (P
.InstallVer
!= (Version
*)Pkg
.CurrentVer() ||
200 (P
.iFlags
& ReInstall
) == ReInstall
) && P
.InstallVer
!= 0)
202 iUsrSize
+= (signed)(Mult
*((signed)P
.InstVerIter(*this)->InstalledSize
-
203 (signed)Pkg
.CurrentVer()->InstalledSize
));
204 iDownloadSize
+= (signed)(Mult
*P
.InstVerIter(*this)->Size
);
209 if (Pkg
.State() == pkgCache::PkgIterator::NeedsUnpack
&&
212 iDownloadSize
+= (signed)(Mult
*P
.InstVerIter(*this)->Size
);
217 if (Pkg
->CurrentVer
!= 0 && P
.InstallVer
== 0)
219 iUsrSize
-= (signed)(Mult
*Pkg
.CurrentVer()->InstalledSize
);
224 // DepCache::AddStates - Add the package to the state counter /*{{{*/
225 // ---------------------------------------------------------------------
226 /* This routine is tricky to use, you must make sure that it is never
227 called twice for the same package. This means the Remove/Add section
228 should be as short as possible and not encompass any code that will
229 calld Remove/Add itself. Remember, dependencies can be circular so
230 while processing a dep for Pkg it is possible that Add/Remove
231 will be called on Pkg */
232 void pkgDepCache::AddStates(const PkgIterator
&Pkg
,int Add
)
234 StateCache
&State
= PkgState
[Pkg
->ID
];
236 // The Package is broken
237 if ((State
.DepState
& DepInstMin
) != DepInstMin
)
241 if (Pkg
.State() != PkgIterator::NeedsNothing
)
245 if (Pkg
->CurrentVer
== 0)
247 if (State
.Mode
== ModeDelete
&&
248 (State
.iFlags
| Purge
) == Purge
&& Pkg
.Purge() == false)
251 if (State
.Mode
== ModeInstall
)
256 // Installed, no upgrade
257 if (State
.Status
== 0)
259 if (State
.Mode
== ModeDelete
)
262 if ((State
.iFlags
& ReInstall
) == ReInstall
)
268 // Alll 3 are possible
269 if (State
.Mode
== ModeDelete
)
271 if (State
.Mode
== ModeKeep
)
273 if (State
.Mode
== ModeInstall
)
277 // DepCache::BuildGroupOrs - Generate the Or group dep data /*{{{*/
278 // ---------------------------------------------------------------------
279 /* The or group results are stored in the last item of the or group. This
280 allows easy detection of the state of a whole or'd group. */
281 void pkgDepCache::BuildGroupOrs(VerIterator
const &V
)
283 unsigned char Group
= 0;
285 for (DepIterator D
= V
.DependsList(); D
.end() != true; D
++)
287 // Build the dependency state.
288 unsigned char &State
= DepState
[D
->ID
];
290 /* Invert for Conflicts. We have to do this twice to get the
291 right sense for a conflicts group */
292 if (D
->Type
== Dep::Conflicts
|| D
->Type
== Dep::Obsoletes
)
295 // Add to the group if we are within an or..
299 if ((D
->CompareOp
& Dep::Or
) != Dep::Or
)
302 // Invert for Conflicts
303 if (D
->Type
== Dep::Conflicts
|| D
->Type
== Dep::Obsoletes
)
308 // DepCache::VersionState - Perform a pass over a dependency list /*{{{*/
309 // ---------------------------------------------------------------------
310 /* This is used to run over a dependency list and determine the dep
311 state of the list, filtering it through both a Min check and a Policy
312 check. The return result will have SetMin/SetPolicy low if a check
313 fails. It uses the DepState cache for it's computations. */
314 unsigned char pkgDepCache::VersionState(DepIterator D
,unsigned char Check
,
315 unsigned char SetMin
,
316 unsigned char SetPolicy
)
318 unsigned char Dep
= 0xFF;
320 while (D
.end() != true)
322 // Compute a single dependency element (glob or)
323 DepIterator Start
= D
;
324 unsigned char State
= 0;
325 for (bool LastOR
= true; D
.end() == false && LastOR
== true; D
++)
327 State
|= DepState
[D
->ID
];
328 LastOR
= (D
->CompareOp
& Dep::Or
) == Dep::Or
;
331 // Minimum deps that must be satisfied to have a working package
332 if (Start
.IsCritical() == true)
333 if ((State
& Check
) != Check
)
336 // Policy deps that must be satisfied to install the package
337 if (IsImportantDep(Start
) == true &&
338 (State
& Check
) != Check
)
345 // DepCache::DependencyState - Compute the 3 results for a dep /*{{{*/
346 // ---------------------------------------------------------------------
347 /* This is the main dependency computation bit. It computes the 3 main
348 results for a dependencys, Now, Install and Candidate. Callers must
349 invert the result if dealing with conflicts. */
350 unsigned char pkgDepCache::DependencyState(DepIterator
&D
)
352 unsigned char State
= 0;
354 if (CheckDep(D
,NowVersion
) == true)
356 if (CheckDep(D
,InstallVersion
) == true)
358 if (CheckDep(D
,CandidateVersion
) == true)
364 // DepCache::UpdateVerState - Compute the Dep member of the state /*{{{*/
365 // ---------------------------------------------------------------------
366 /* This determines the combined dependency representation of a package
367 for its two states now and install. This is done by using the pre-generated
368 dependency information. */
369 void pkgDepCache::UpdateVerState(PkgIterator Pkg
)
371 // Empty deps are always true
372 StateCache
&State
= PkgState
[Pkg
->ID
];
373 State
.DepState
= 0xFF;
375 // Check the Current state
376 if (Pkg
->CurrentVer
!= 0)
378 DepIterator D
= Pkg
.CurrentVer().DependsList();
379 State
.DepState
&= VersionState(D
,DepNow
,DepNowMin
,DepNowPolicy
);
382 /* Check the candidate state. We do not compare against the whole as
383 a candidate state but check the candidate version against the
385 if (State
.CandidateVer
!= 0)
387 DepIterator D
= State
.CandidateVerIter(*this).DependsList();
388 State
.DepState
&= VersionState(D
,DepInstall
,DepCandMin
,DepCandPolicy
);
391 // Check target state which can only be current or installed
392 if (State
.InstallVer
!= 0)
394 DepIterator D
= State
.InstVerIter(*this).DependsList();
395 State
.DepState
&= VersionState(D
,DepInstall
,DepInstMin
,DepInstPolicy
);
399 // DepCache::Update - Figure out all the state information /*{{{*/
400 // ---------------------------------------------------------------------
401 /* This will figure out the state of all the packages and all the
402 dependencies based on the current policy. */
403 void pkgDepCache::Update(OpProgress
*Prog
)
413 // Perform the depends pass
415 for (PkgIterator I
= PkgBegin(); I
.end() != true; I
++,Done
++)
417 if (Prog
!= 0 && Done%20
== 0)
418 Prog
->Progress(Done
);
419 for (VerIterator V
= I
.VersionList(); V
.end() != true; V
++)
421 unsigned char Group
= 0;
423 for (DepIterator D
= V
.DependsList(); D
.end() != true; D
++)
425 // Build the dependency state.
426 unsigned char &State
= DepState
[D
->ID
];
427 State
= DependencyState(D
);
429 // Add to the group if we are within an or..
432 if ((D
->CompareOp
& Dep::Or
) != Dep::Or
)
435 // Invert for Conflicts
436 if (D
->Type
== Dep::Conflicts
|| D
->Type
== Dep::Obsoletes
)
441 // Compute the pacakge dependency state and size additions
448 Prog
->Progress(Done
);
451 // DepCache::Update - Update the deps list of a package /*{{{*/
452 // ---------------------------------------------------------------------
453 /* This is a helper for update that only does the dep portion of the scan.
454 It is mainly ment to scan reverse dependencies. */
455 void pkgDepCache::Update(DepIterator D
)
457 // Update the reverse deps
458 for (;D
.end() != true; D
++)
460 unsigned char &State
= DepState
[D
->ID
];
461 State
= DependencyState(D
);
463 // Invert for Conflicts
464 if (D
->Type
== Dep::Conflicts
|| D
->Type
== Dep::Obsoletes
)
467 RemoveStates(D
.ParentPkg());
468 BuildGroupOrs(D
.ParentVer());
469 UpdateVerState(D
.ParentPkg());
470 AddStates(D
.ParentPkg());
474 // DepCache::Update - Update the related deps of a package /*{{{*/
475 // ---------------------------------------------------------------------
476 /* This is called whenever the state of a package changes. It updates
477 all cached dependencies related to this package. */
478 void pkgDepCache::Update(PkgIterator
const &Pkg
)
480 // Recompute the dep of the package
485 // Update the reverse deps
486 Update(Pkg
.RevDependsList());
488 // Update the provides map for the current ver
489 if (Pkg
->CurrentVer
!= 0)
490 for (PrvIterator P
= Pkg
.CurrentVer().ProvidesList();
491 P
.end() != true; P
++)
492 Update(P
.ParentPkg().RevDependsList());
494 // Update the provides map for the candidate ver
495 if (PkgState
[Pkg
->ID
].CandidateVer
!= 0)
496 for (PrvIterator P
= PkgState
[Pkg
->ID
].CandidateVerIter(*this).ProvidesList();
497 P
.end() != true; P
++)
498 Update(P
.ParentPkg().RevDependsList());
503 // DepCache::MarkKeep - Put the package in the keep state /*{{{*/
504 // ---------------------------------------------------------------------
506 void pkgDepCache::MarkKeep(PkgIterator
const &Pkg
,bool Soft
)
508 // Simplifies other routines.
509 if (Pkg
.end() == true)
512 /* Reject an attempt to keep a non-source broken installed package, those
514 if (Pkg
.State() == PkgIterator::NeedsUnpack
&&
515 Pkg
.CurrentVer().Downloadable() == false)
518 /* We changed the soft state all the time so the UI is a bit nicer
520 StateCache
&P
= PkgState
[Pkg
->ID
];
522 P
.iFlags
|= AutoKept
;
524 P
.iFlags
&= ~AutoKept
;
526 // Check that it is not already kept
527 if (P
.Mode
== ModeKeep
)
530 // We dont even try to keep virtual packages..
531 if (Pkg
->VersionList
== 0)
534 P
.Flags
&= ~Flag::Auto
;
539 if (Pkg
->CurrentVer
== 0)
542 P
.InstallVer
= Pkg
.CurrentVer();
551 // DepCache::MarkDelete - Put the package in the delete state /*{{{*/
552 // ---------------------------------------------------------------------
554 void pkgDepCache::MarkDelete(PkgIterator
const &Pkg
, bool rPurge
)
556 // Simplifies other routines.
557 if (Pkg
.end() == true)
560 // Check that it is not already marked for delete
561 StateCache
&P
= PkgState
[Pkg
->ID
];
562 P
.iFlags
&= ~(AutoKept
| Purge
);
566 if ((P
.Mode
== ModeDelete
|| P
.InstallVer
== 0) &&
567 (Pkg
.Purge() == true || rPurge
== false))
570 // We dont even try to delete virtual packages..
571 if (Pkg
->VersionList
== 0)
577 if (Pkg
->CurrentVer
== 0 && (Pkg
.Purge() == true || rPurge
== false))
582 P
.Flags
&= Flag::Auto
;
589 // DepCache::MarkInstall - Put the package in the install state /*{{{*/
590 // ---------------------------------------------------------------------
592 void pkgDepCache::MarkInstall(PkgIterator
const &Pkg
,bool AutoInst
,
598 // Simplifies other routines.
599 if (Pkg
.end() == true)
602 /* Check that it is not already marked for install and that it can be
604 StateCache
&P
= PkgState
[Pkg
->ID
];
605 P
.iFlags
&= ~AutoKept
;
606 if (P
.InstBroken() == false && (P
.Mode
== ModeInstall
||
607 P
.CandidateVer
== (Version
*)Pkg
.CurrentVer()))
609 if (P
.CandidateVer
== (Version
*)Pkg
.CurrentVer() && P
.InstallVer
== 0)
614 // See if there is even any possible instalation candidate
615 if (P
.CandidateVer
== 0)
618 // We dont even try to install virtual packages..
619 if (Pkg
->VersionList
== 0)
622 /* Target the candidate version and remove the autoflag. We reset the
623 autoflag below if this was called recursively. Otherwise the user
624 should have the ability to de-auto a package by changing its state */
628 P
.Mode
= ModeInstall
;
629 P
.InstallVer
= P
.CandidateVer
;
630 P
.Flags
&= ~Flag::Auto
;
631 if (P
.CandidateVer
== (Version
*)Pkg
.CurrentVer())
638 if (AutoInst
== false)
641 DepIterator Dep
= P
.InstVerIter(*this).DependsList();
642 for (; Dep
.end() != true;)
645 DepIterator Start
= Dep
;
648 for (bool LastOR
= true; Dep
.end() == false && LastOR
== true; Dep
++,Ors
++)
650 LastOR
= (Dep
->CompareOp
& Dep::Or
) == Dep::Or
;
652 if ((DepState
[Dep
->ID
] & DepInstall
) == DepInstall
)
656 // Dep is satisfied okay.
660 /* Check if this dep should be consider for install. If it is a user
661 defined important dep and we are installed a new package then
662 it will be installed. Otherwise we only worry about critical deps */
663 if (IsImportantDep(Start
) == false)
665 if (Pkg
->CurrentVer
!= 0 && Start
.IsCritical() == false)
668 /* If we are in an or group locate the first or that can
669 succeed. We have already cached this.. */
670 for (; Ors
> 1 && (DepState
[Start
->ID
] & DepCVer
) != DepCVer
; Ors
--)
673 /* This bit is for processing the possibilty of an install/upgrade
674 fixing the problem */
675 SPtrArray
<Version
*> List
= Start
.AllTargets();
676 if ((DepState
[Start
->ID
] & DepCVer
) == DepCVer
)
678 // Right, find the best version to install..
679 Version
**Cur
= List
;
680 PkgIterator P
= Start
.TargetPkg();
681 PkgIterator
InstPkg(*Cache
,0);
683 // See if there are direct matches (at the start of the list)
684 for (; *Cur
!= 0 && (*Cur
)->ParentPkg
== P
.Index(); Cur
++)
686 PkgIterator
Pkg(*Cache
,Cache
->PkgP
+ (*Cur
)->ParentPkg
);
687 if (PkgState
[Pkg
->ID
].CandidateVer
!= *Cur
)
693 // Select the highest priority providing package
694 if (InstPkg
.end() == false)
696 pkgPrioSortList(*Cache
,Cur
);
697 for (; *Cur
!= 0; Cur
++)
699 PkgIterator
Pkg(*Cache
,Cache
->PkgP
+ (*Cur
)->ParentPkg
);
700 if (PkgState
[Pkg
->ID
].CandidateVer
!= *Cur
)
707 if (InstPkg
.end() == false)
709 MarkInstall(InstPkg
,true,Depth
+ 1);
711 // Set the autoflag, after MarkInstall because MarkInstall unsets it
712 if (P
->CurrentVer
== 0)
713 PkgState
[InstPkg
->ID
].Flags
|= Flag::Auto
;
719 /* For conflicts we just de-install the package and mark as auto,
720 Conflicts may not have or groups */
721 if (Start
->Type
== Dep::Conflicts
|| Start
->Type
== Dep::Obsoletes
)
723 for (Version
**I
= List
; *I
!= 0; I
++)
725 VerIterator
Ver(*this,*I
);
726 PkgIterator Pkg
= Ver
.ParentPkg();
729 PkgState
[Pkg
->ID
].Flags
|= Flag::Auto
;
736 // DepCache::SetReInstall - Set the reinstallation flag /*{{{*/
737 // ---------------------------------------------------------------------
739 void pkgDepCache::SetReInstall(PkgIterator
const &Pkg
,bool To
)
744 StateCache
&P
= PkgState
[Pkg
->ID
];
746 P
.iFlags
|= ReInstall
;
748 P
.iFlags
&= ~ReInstall
;
754 // DepCache::SetCandidateVersion - Change the candidate version /*{{{*/
755 // ---------------------------------------------------------------------
757 void pkgDepCache::SetCandidateVersion(VerIterator TargetVer
)
759 pkgCache::PkgIterator Pkg
= TargetVer
.ParentPkg();
760 StateCache
&P
= PkgState
[Pkg
->ID
];
765 if (P
.CandidateVer
== P
.InstallVer
)
766 P
.InstallVer
= (Version
*)TargetVer
;
767 P
.CandidateVer
= (Version
*)TargetVer
;
775 // StateCache::Update - Compute the various static display things /*{{{*/
776 // ---------------------------------------------------------------------
777 /* This is called whenever the Candidate version changes. */
778 void pkgDepCache::StateCache::Update(PkgIterator Pkg
,pkgCache
&Cache
)
781 VerIterator Ver
= CandidateVerIter(Cache
);
783 // Use a null string or the version string
784 if (Ver
.end() == true)
787 CandVersion
= Ver
.VerStr();
789 // Find the current version
791 if (Pkg
->CurrentVer
!= 0)
792 CurVersion
= Pkg
.CurrentVer().VerStr();
794 // Strip off the epochs for display
795 CurVersion
= StripEpoch(CurVersion
);
796 CandVersion
= StripEpoch(CandVersion
);
798 // Figure out if its up or down or equal
799 Status
= Ver
.CompareVer(Pkg
.CurrentVer());
800 if (Pkg
->CurrentVer
== 0 || Pkg
->VersionList
== 0 || CandidateVer
== 0)
804 // StateCache::StripEpoch - Remove the epoch specifier from the version /*{{{*/
805 // ---------------------------------------------------------------------
807 const char *pkgDepCache::StateCache::StripEpoch(const char *Ver
)
813 for (const char *I
= Ver
; *I
!= 0; I
++)
820 // Policy::GetCandidateVer - Returns the Candidate install version /*{{{*/
821 // ---------------------------------------------------------------------
822 /* The default just returns the highest available version that is not
823 a source and automatic. */
824 pkgCache::VerIterator
pkgDepCache::Policy::GetCandidateVer(PkgIterator Pkg
)
826 /* Not source/not automatic versions cannot be a candidate version
827 unless they are already installed */
828 VerIterator
Last(*(pkgCache
*)this,0);
830 for (VerIterator I
= Pkg
.VersionList(); I
.end() == false; I
++)
832 if (Pkg
.CurrentVer() == I
)
835 for (VerFileIterator J
= I
.FileList(); J
.end() == false; J
++)
837 if ((J
.File()->Flags
& Flag::NotSource
) != 0)
840 /* Stash the highest version of a not-automatic source, we use it
841 if there is nothing better */
842 if ((J
.File()->Flags
& Flag::NotAutomatic
) != 0)
844 if (Last
.end() == true)
856 // Policy::IsImportantDep - True if the dependency is important /*{{{*/
857 // ---------------------------------------------------------------------
859 bool pkgDepCache::Policy::IsImportantDep(DepIterator Dep
)
861 return Dep
.IsCritical();