bool VisitPackageVersions(PackageDependency dependency)
        {
            KeyValuePair<PackageIdentifier, IPackageInfo>? packageVersion;
            var seen = new List<PackageIdentifier>();
            while ((packageVersion = NextAvailablePackageVersion(seen, dependency)) != null)
            {
                seen.Add(packageVersion.Value.Key);
                _selectionContext.Trying(packageVersion.Value.Key);
                PushStack(packageVersion.Value.Key);

                IPackageInfo package = packageVersion.Value.Value;
                if (package != null && VisitDependencies(package.Dependencies))
                {
                    _selectionContext.PackageSucceeds(packageVersion.Value.Key, CurrentCallStack);
                    PopStack();
                    WriteDebug("VisitPackage version Succeeded");
                    return true;
                }
                _selectionContext.PackageHasChildrenConflicting(packageVersion.Value.Key);
                PopStack();
                WriteDebug("VisitPackage version failed");
            }
            WriteDebug("VisitPackage failed");
            if (seen.Empty())
            {
                _notFound.Add(new KeyValuePair<PackageDependency, CallStack>(dependency, CurrentCallStack));
            }
            return false;
        }
Example #2
0
        bool VisitPackageVersions(PackageDependency dependency)
        {
            IPackageInfo packageVersion;
            var seen = new List<PackageIdentifier>();
            while ((packageVersion = NextAvailablePackageVersion(seen, dependency)) != null)
            {
                seen.Add(packageVersion.Identifier);
                _selectionContext.Trying(packageVersion.Identifier);
                PushStack(packageVersion.Identifier);

                if (VisitDependencies(packageVersion.Dependencies))
                {
                    _selectionContext.PackageSucceeds(packageVersion.Identifier, CurrentCallStack);
                    WriteDebug("dependency: version found");
                    PopStack();
                    return true;
                }
                _selectionContext.PackageHasChildrenConflicting(packageVersion.Identifier);
                WriteDebug("dependency: version didn't match");
                PopStack();
            }
            WriteDebug("dependency: no version matches");
            if (seen.Empty())
            {
                _notFound.Add(new KeyValuePair<PackageDependency, CallStack>(dependency, CurrentCallStack));
            }
            return false;
        }