// Check the providing packages
PrvIterator P = Dep.TargetPkg().ProvidesList();
- PkgIterator Pkg = Dep.ParentPkg();
for (; P.end() != true; ++P)
{
- if (Dep.IsNegative() == true)
- {
- /* Provides may never be applied against the same package (or group)
- if it is a conflicts. See the comment above. */
- if (P.OwnerPkg()->Group == Pkg->Group)
- continue;
- // Implicit group-conflicts should not be applied on providers of other groups
- if (Pkg->Group == Dep.TargetPkg()->Group && P.OwnerPkg()->Group != Pkg->Group)
- continue;
- }
+ if (Dep.IsIgnorable(P) == true)
+ continue;
// Check if the provides is a hit
if (Type == NowVersion)
// Walk along the actual package providing versions
for (VerIterator I = DPkg.VersionList(); I.end() == false; ++I)
{
- if (Owner->VS->CheckDep(I.VerStr(),S->CompareOp,TargetVer()) == false)
+ if (IsIgnorable(I.ParentPkg()) == true)
continue;
- if (IsNegative() == true &&
- ParentPkg() == I.ParentPkg())
+ if (Owner->VS->CheckDep(I.VerStr(),S->CompareOp,TargetVer()) == false)
continue;
-
+
Size++;
if (Res != 0)
*End++ = I;
// Follow all provides
for (PrvIterator I = DPkg.ProvidesList(); I.end() == false; ++I)
{
- if (Owner->VS->CheckDep(I.ProvideVersion(),S->CompareOp,TargetVer()) == false)
+ if (IsIgnorable(I) == true)
continue;
- if (IsNegative() == true)
- {
- /* Provides may never be applied against the same package (or group)
- if it is a conflicts. See the comment above. */
- if (I.OwnerPkg()->Group == ParentPkg()->Group)
- continue;
- // Implicit group-conflicts should not be applied on providers of other groups
- if (ParentPkg()->Group == TargetPkg()->Group && I.OwnerPkg()->Group != ParentPkg()->Group)
- continue;
- }
+ if (Owner->VS->CheckDep(I.ProvideVersion(),S->CompareOp,TargetVer()) == false)
+ continue;
Size++;
if (Res != 0)
}
}
/*}}}*/
+// DepIterator::IsIgnorable - should this packag/providr be ignored? /*{{{*/
+// ---------------------------------------------------------------------
+/* Deps like self-conflicts should be ignored as well as implicit conflicts
+ on virtual packages. */
+bool pkgCache::DepIterator::IsIgnorable(PkgIterator const &Pkg) const
+{
+ if (ParentPkg() == TargetPkg())
+ return IsNegative();
+
+ return false;
+}
+bool pkgCache::DepIterator::IsIgnorable(PrvIterator const &Prv) const
+{
+ if (IsNegative() == false)
+ return false;
+
+ PkgIterator const Pkg = ParentPkg();
+ /* Provides may never be applied against the same package (or group)
+ if it is a conflicts. See the comment above. */
+ if (Prv.OwnerPkg()->Group == Pkg->Group)
+ return true;
+ // Implicit group-conflicts should not be applied on providers of other groups
+ if (Pkg->Group == TargetPkg()->Group && Prv.OwnerPkg()->Group != Pkg->Group)
+ return true;
+
+ return false;
+}
+ /*}}}*/
// ostream operator to handle string representation of a dependecy /*{{{*/
// ---------------------------------------------------------------------
/* */