]>
git.saurik.com Git - apt.git/blob - apt-pkg/depcache.cc
c6bf3185ae2b09bb4e093c6d91a02bf53f544b15
1 // -*- mode: cpp; mode: fold -*-
3 // $Id: depcache.cc,v 1.25 2001/05/27 05:36:04 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
->VersionList
== 0)
188 if (Pkg
.State() == pkgCache::PkgIterator::NeedsConfigure
&&
192 // Compute the size data
193 if (P
.NewInstall() == true)
195 iUsrSize
+= (signed)(Mult
*P
.InstVerIter(*this)->InstalledSize
);
196 iDownloadSize
+= (signed)(Mult
*P
.InstVerIter(*this)->Size
);
201 if (Pkg
->CurrentVer
!= 0 &&
202 (P
.InstallVer
!= (Version
*)Pkg
.CurrentVer() ||
203 (P
.iFlags
& ReInstall
) == ReInstall
) && P
.InstallVer
!= 0)
205 iUsrSize
+= (signed)(Mult
*((signed)P
.InstVerIter(*this)->InstalledSize
-
206 (signed)Pkg
.CurrentVer()->InstalledSize
));
207 iDownloadSize
+= (signed)(Mult
*P
.InstVerIter(*this)->Size
);
212 if (Pkg
.State() == pkgCache::PkgIterator::NeedsUnpack
&&
215 iDownloadSize
+= (signed)(Mult
*P
.InstVerIter(*this)->Size
);
220 if (Pkg
->CurrentVer
!= 0 && P
.InstallVer
== 0)
222 iUsrSize
-= (signed)(Mult
*Pkg
.CurrentVer()->InstalledSize
);
227 // DepCache::AddStates - Add the package to the state counter /*{{{*/
228 // ---------------------------------------------------------------------
229 /* This routine is tricky to use, you must make sure that it is never
230 called twice for the same package. This means the Remove/Add section
231 should be as short as possible and not encompass any code that will
232 calld Remove/Add itself. Remember, dependencies can be circular so
233 while processing a dep for Pkg it is possible that Add/Remove
234 will be called on Pkg */
235 void pkgDepCache::AddStates(const PkgIterator
&Pkg
,int Add
)
237 StateCache
&State
= PkgState
[Pkg
->ID
];
239 // The Package is broken
240 if ((State
.DepState
& DepInstMin
) != DepInstMin
)
244 if (Pkg
.State() != PkgIterator::NeedsNothing
)
248 if (Pkg
->CurrentVer
== 0)
250 if (State
.Mode
== ModeDelete
&&
251 (State
.iFlags
| Purge
) == Purge
&& Pkg
.Purge() == false)
254 if (State
.Mode
== ModeInstall
)
259 // Installed, no upgrade
260 if (State
.Status
== 0)
262 if (State
.Mode
== ModeDelete
)
265 if ((State
.iFlags
& ReInstall
) == ReInstall
)
271 // Alll 3 are possible
272 if (State
.Mode
== ModeDelete
)
274 if (State
.Mode
== ModeKeep
)
276 if (State
.Mode
== ModeInstall
)
280 // DepCache::BuildGroupOrs - Generate the Or group dep data /*{{{*/
281 // ---------------------------------------------------------------------
282 /* The or group results are stored in the last item of the or group. This
283 allows easy detection of the state of a whole or'd group. */
284 void pkgDepCache::BuildGroupOrs(VerIterator
const &V
)
286 unsigned char Group
= 0;
288 for (DepIterator D
= V
.DependsList(); D
.end() != true; D
++)
290 // Build the dependency state.
291 unsigned char &State
= DepState
[D
->ID
];
293 /* Invert for Conflicts. We have to do this twice to get the
294 right sense for a conflicts group */
295 if (D
->Type
== Dep::Conflicts
|| D
->Type
== Dep::Obsoletes
)
298 // Add to the group if we are within an or..
302 if ((D
->CompareOp
& Dep::Or
) != Dep::Or
)
305 // Invert for Conflicts
306 if (D
->Type
== Dep::Conflicts
|| D
->Type
== Dep::Obsoletes
)
311 // DepCache::VersionState - Perform a pass over a dependency list /*{{{*/
312 // ---------------------------------------------------------------------
313 /* This is used to run over a dependency list and determine the dep
314 state of the list, filtering it through both a Min check and a Policy
315 check. The return result will have SetMin/SetPolicy low if a check
316 fails. It uses the DepState cache for it's computations. */
317 unsigned char pkgDepCache::VersionState(DepIterator D
,unsigned char Check
,
318 unsigned char SetMin
,
319 unsigned char SetPolicy
)
321 unsigned char Dep
= 0xFF;
323 while (D
.end() != true)
325 // Compute a single dependency element (glob or)
326 DepIterator Start
= D
;
327 unsigned char State
= 0;
328 for (bool LastOR
= true; D
.end() == false && LastOR
== true; D
++)
330 State
|= DepState
[D
->ID
];
331 LastOR
= (D
->CompareOp
& Dep::Or
) == Dep::Or
;
334 // Minimum deps that must be satisfied to have a working package
335 if (Start
.IsCritical() == true)
336 if ((State
& Check
) != Check
)
339 // Policy deps that must be satisfied to install the package
340 if (IsImportantDep(Start
) == true &&
341 (State
& Check
) != Check
)
348 // DepCache::DependencyState - Compute the 3 results for a dep /*{{{*/
349 // ---------------------------------------------------------------------
350 /* This is the main dependency computation bit. It computes the 3 main
351 results for a dependencys, Now, Install and Candidate. Callers must
352 invert the result if dealing with conflicts. */
353 unsigned char pkgDepCache::DependencyState(DepIterator
&D
)
355 unsigned char State
= 0;
357 if (CheckDep(D
,NowVersion
) == true)
359 if (CheckDep(D
,InstallVersion
) == true)
361 if (CheckDep(D
,CandidateVersion
) == true)
367 // DepCache::UpdateVerState - Compute the Dep member of the state /*{{{*/
368 // ---------------------------------------------------------------------
369 /* This determines the combined dependency representation of a package
370 for its two states now and install. This is done by using the pre-generated
371 dependency information. */
372 void pkgDepCache::UpdateVerState(PkgIterator Pkg
)
374 // Empty deps are always true
375 StateCache
&State
= PkgState
[Pkg
->ID
];
376 State
.DepState
= 0xFF;
378 // Check the Current state
379 if (Pkg
->CurrentVer
!= 0)
381 DepIterator D
= Pkg
.CurrentVer().DependsList();
382 State
.DepState
&= VersionState(D
,DepNow
,DepNowMin
,DepNowPolicy
);
385 /* Check the candidate state. We do not compare against the whole as
386 a candidate state but check the candidate version against the
388 if (State
.CandidateVer
!= 0)
390 DepIterator D
= State
.CandidateVerIter(*this).DependsList();
391 State
.DepState
&= VersionState(D
,DepInstall
,DepCandMin
,DepCandPolicy
);
394 // Check target state which can only be current or installed
395 if (State
.InstallVer
!= 0)
397 DepIterator D
= State
.InstVerIter(*this).DependsList();
398 State
.DepState
&= VersionState(D
,DepInstall
,DepInstMin
,DepInstPolicy
);
402 // DepCache::Update - Figure out all the state information /*{{{*/
403 // ---------------------------------------------------------------------
404 /* This will figure out the state of all the packages and all the
405 dependencies based on the current policy. */
406 void pkgDepCache::Update(OpProgress
*Prog
)
416 // Perform the depends pass
418 for (PkgIterator I
= PkgBegin(); I
.end() != true; I
++,Done
++)
420 if (Prog
!= 0 && Done%20
== 0)
421 Prog
->Progress(Done
);
422 for (VerIterator V
= I
.VersionList(); V
.end() != true; V
++)
424 unsigned char Group
= 0;
426 for (DepIterator D
= V
.DependsList(); D
.end() != true; D
++)
428 // Build the dependency state.
429 unsigned char &State
= DepState
[D
->ID
];
430 State
= DependencyState(D
);
432 // Add to the group if we are within an or..
435 if ((D
->CompareOp
& Dep::Or
) != Dep::Or
)
438 // Invert for Conflicts
439 if (D
->Type
== Dep::Conflicts
|| D
->Type
== Dep::Obsoletes
)
444 // Compute the pacakge dependency state and size additions
451 Prog
->Progress(Done
);
454 // DepCache::Update - Update the deps list of a package /*{{{*/
455 // ---------------------------------------------------------------------
456 /* This is a helper for update that only does the dep portion of the scan.
457 It is mainly ment to scan reverse dependencies. */
458 void pkgDepCache::Update(DepIterator D
)
460 // Update the reverse deps
461 for (;D
.end() != true; D
++)
463 unsigned char &State
= DepState
[D
->ID
];
464 State
= DependencyState(D
);
466 // Invert for Conflicts
467 if (D
->Type
== Dep::Conflicts
|| D
->Type
== Dep::Obsoletes
)
470 RemoveStates(D
.ParentPkg());
471 BuildGroupOrs(D
.ParentVer());
472 UpdateVerState(D
.ParentPkg());
473 AddStates(D
.ParentPkg());
477 // DepCache::Update - Update the related deps of a package /*{{{*/
478 // ---------------------------------------------------------------------
479 /* This is called whenever the state of a package changes. It updates
480 all cached dependencies related to this package. */
481 void pkgDepCache::Update(PkgIterator
const &Pkg
)
483 // Recompute the dep of the package
488 // Update the reverse deps
489 Update(Pkg
.RevDependsList());
491 // Update the provides map for the current ver
492 if (Pkg
->CurrentVer
!= 0)
493 for (PrvIterator P
= Pkg
.CurrentVer().ProvidesList();
494 P
.end() != true; P
++)
495 Update(P
.ParentPkg().RevDependsList());
497 // Update the provides map for the candidate ver
498 if (PkgState
[Pkg
->ID
].CandidateVer
!= 0)
499 for (PrvIterator P
= PkgState
[Pkg
->ID
].CandidateVerIter(*this).ProvidesList();
500 P
.end() != true; P
++)
501 Update(P
.ParentPkg().RevDependsList());
506 // DepCache::MarkKeep - Put the package in the keep state /*{{{*/
507 // ---------------------------------------------------------------------
509 void pkgDepCache::MarkKeep(PkgIterator
const &Pkg
,bool Soft
)
511 // Simplifies other routines.
512 if (Pkg
.end() == true)
515 /* Reject an attempt to keep a non-source broken installed package, those
517 if (Pkg
.State() == PkgIterator::NeedsUnpack
&&
518 Pkg
.CurrentVer().Downloadable() == false)
521 /* We changed the soft state all the time so the UI is a bit nicer
523 StateCache
&P
= PkgState
[Pkg
->ID
];
525 P
.iFlags
|= AutoKept
;
527 P
.iFlags
&= ~AutoKept
;
529 // Check that it is not already kept
530 if (P
.Mode
== ModeKeep
)
533 // We dont even try to keep virtual packages..
534 if (Pkg
->VersionList
== 0)
537 P
.Flags
&= ~Flag::Auto
;
542 if (Pkg
->CurrentVer
== 0)
545 P
.InstallVer
= Pkg
.CurrentVer();
554 // DepCache::MarkDelete - Put the package in the delete state /*{{{*/
555 // ---------------------------------------------------------------------
557 void pkgDepCache::MarkDelete(PkgIterator
const &Pkg
, bool rPurge
)
559 // Simplifies other routines.
560 if (Pkg
.end() == true)
563 // Check that it is not already marked for delete
564 StateCache
&P
= PkgState
[Pkg
->ID
];
565 P
.iFlags
&= ~(AutoKept
| Purge
);
569 if ((P
.Mode
== ModeDelete
|| P
.InstallVer
== 0) &&
570 (Pkg
.Purge() == true || rPurge
== false))
573 // We dont even try to delete virtual packages..
574 if (Pkg
->VersionList
== 0)
580 if (Pkg
->CurrentVer
== 0 && (Pkg
.Purge() == true || rPurge
== false))
585 P
.Flags
&= Flag::Auto
;
592 // DepCache::MarkInstall - Put the package in the install state /*{{{*/
593 // ---------------------------------------------------------------------
595 void pkgDepCache::MarkInstall(PkgIterator
const &Pkg
,bool AutoInst
,
601 // Simplifies other routines.
602 if (Pkg
.end() == true)
605 /* Check that it is not already marked for install and that it can be
607 StateCache
&P
= PkgState
[Pkg
->ID
];
608 P
.iFlags
&= ~AutoKept
;
609 if (P
.InstBroken() == false && (P
.Mode
== ModeInstall
||
610 P
.CandidateVer
== (Version
*)Pkg
.CurrentVer()))
612 if (P
.CandidateVer
== (Version
*)Pkg
.CurrentVer() && P
.InstallVer
== 0)
617 // See if there is even any possible instalation candidate
618 if (P
.CandidateVer
== 0)
621 // We dont even try to install virtual packages..
622 if (Pkg
->VersionList
== 0)
625 /* Target the candidate version and remove the autoflag. We reset the
626 autoflag below if this was called recursively. Otherwise the user
627 should have the ability to de-auto a package by changing its state */
631 P
.Mode
= ModeInstall
;
632 P
.InstallVer
= P
.CandidateVer
;
633 P
.Flags
&= ~Flag::Auto
;
634 if (P
.CandidateVer
== (Version
*)Pkg
.CurrentVer())
641 if (AutoInst
== false)
644 DepIterator Dep
= P
.InstVerIter(*this).DependsList();
645 for (; Dep
.end() != true;)
648 DepIterator Start
= Dep
;
651 for (bool LastOR
= true; Dep
.end() == false && LastOR
== true; Dep
++,Ors
++)
653 LastOR
= (Dep
->CompareOp
& Dep::Or
) == Dep::Or
;
655 if ((DepState
[Dep
->ID
] & DepInstall
) == DepInstall
)
659 // Dep is satisfied okay.
663 /* Check if this dep should be consider for install. If it is a user
664 defined important dep and we are installed a new package then
665 it will be installed. Otherwise we only worry about critical deps */
666 if (IsImportantDep(Start
) == false)
668 if (Pkg
->CurrentVer
!= 0 && Start
.IsCritical() == false)
671 /* If we are in an or group locate the first or that can
672 succeed. We have already cached this.. */
673 for (; Ors
> 1 && (DepState
[Start
->ID
] & DepCVer
) != DepCVer
; Ors
--)
676 /* This bit is for processing the possibilty of an install/upgrade
677 fixing the problem */
678 SPtrArray
<Version
*> List
= Start
.AllTargets();
679 if ((DepState
[Start
->ID
] & DepCVer
) == DepCVer
)
681 // Right, find the best version to install..
682 Version
**Cur
= List
;
683 PkgIterator P
= Start
.TargetPkg();
684 PkgIterator
InstPkg(*Cache
,0);
686 // See if there are direct matches (at the start of the list)
687 for (; *Cur
!= 0 && (*Cur
)->ParentPkg
== P
.Index(); Cur
++)
689 PkgIterator
Pkg(*Cache
,Cache
->PkgP
+ (*Cur
)->ParentPkg
);
690 if (PkgState
[Pkg
->ID
].CandidateVer
!= *Cur
)
696 // Select the highest priority providing package
697 if (InstPkg
.end() == true)
699 pkgPrioSortList(*Cache
,Cur
);
700 for (; *Cur
!= 0; Cur
++)
702 PkgIterator
Pkg(*Cache
,Cache
->PkgP
+ (*Cur
)->ParentPkg
);
703 if (PkgState
[Pkg
->ID
].CandidateVer
!= *Cur
)
710 if (InstPkg
.end() == false)
712 MarkInstall(InstPkg
,true,Depth
+ 1);
714 // Set the autoflag, after MarkInstall because MarkInstall unsets it
715 if (P
->CurrentVer
== 0)
716 PkgState
[InstPkg
->ID
].Flags
|= Flag::Auto
;
722 /* For conflicts we just de-install the package and mark as auto,
723 Conflicts may not have or groups */
724 if (Start
->Type
== Dep::Conflicts
|| Start
->Type
== Dep::Obsoletes
)
726 for (Version
**I
= List
; *I
!= 0; I
++)
728 VerIterator
Ver(*this,*I
);
729 PkgIterator Pkg
= Ver
.ParentPkg();
732 PkgState
[Pkg
->ID
].Flags
|= Flag::Auto
;
739 // DepCache::SetReInstall - Set the reinstallation flag /*{{{*/
740 // ---------------------------------------------------------------------
742 void pkgDepCache::SetReInstall(PkgIterator
const &Pkg
,bool To
)
747 StateCache
&P
= PkgState
[Pkg
->ID
];
749 P
.iFlags
|= ReInstall
;
751 P
.iFlags
&= ~ReInstall
;
757 // DepCache::SetCandidateVersion - Change the candidate version /*{{{*/
758 // ---------------------------------------------------------------------
760 void pkgDepCache::SetCandidateVersion(VerIterator TargetVer
)
762 pkgCache::PkgIterator Pkg
= TargetVer
.ParentPkg();
763 StateCache
&P
= PkgState
[Pkg
->ID
];
768 if (P
.CandidateVer
== P
.InstallVer
)
769 P
.InstallVer
= (Version
*)TargetVer
;
770 P
.CandidateVer
= (Version
*)TargetVer
;
778 // StateCache::Update - Compute the various static display things /*{{{*/
779 // ---------------------------------------------------------------------
780 /* This is called whenever the Candidate version changes. */
781 void pkgDepCache::StateCache::Update(PkgIterator Pkg
,pkgCache
&Cache
)
784 VerIterator Ver
= CandidateVerIter(Cache
);
786 // Use a null string or the version string
787 if (Ver
.end() == true)
790 CandVersion
= Ver
.VerStr();
792 // Find the current version
794 if (Pkg
->CurrentVer
!= 0)
795 CurVersion
= Pkg
.CurrentVer().VerStr();
797 // Strip off the epochs for display
798 CurVersion
= StripEpoch(CurVersion
);
799 CandVersion
= StripEpoch(CandVersion
);
801 // Figure out if its up or down or equal
802 Status
= Ver
.CompareVer(Pkg
.CurrentVer());
803 if (Pkg
->CurrentVer
== 0 || Pkg
->VersionList
== 0 || CandidateVer
== 0)
807 // StateCache::StripEpoch - Remove the epoch specifier from the version /*{{{*/
808 // ---------------------------------------------------------------------
810 const char *pkgDepCache::StateCache::StripEpoch(const char *Ver
)
816 for (const char *I
= Ver
; *I
!= 0; I
++)
823 // Policy::GetCandidateVer - Returns the Candidate install version /*{{{*/
824 // ---------------------------------------------------------------------
825 /* The default just returns the highest available version that is not
826 a source and automatic. */
827 pkgCache::VerIterator
pkgDepCache::Policy::GetCandidateVer(PkgIterator Pkg
)
829 /* Not source/not automatic versions cannot be a candidate version
830 unless they are already installed */
831 VerIterator
Last(*(pkgCache
*)this,0);
833 for (VerIterator I
= Pkg
.VersionList(); I
.end() == false; I
++)
835 if (Pkg
.CurrentVer() == I
)
838 for (VerFileIterator J
= I
.FileList(); J
.end() == false; J
++)
840 if ((J
.File()->Flags
& Flag::NotSource
) != 0)
843 /* Stash the highest version of a not-automatic source, we use it
844 if there is nothing better */
845 if ((J
.File()->Flags
& Flag::NotAutomatic
) != 0)
847 if (Last
.end() == true)
859 // Policy::IsImportantDep - True if the dependency is important /*{{{*/
860 // ---------------------------------------------------------------------
862 bool pkgDepCache::Policy::IsImportantDep(DepIterator Dep
)
864 return Dep
.IsCritical();