public void Report(PackageLookupResult lookupResult)
        {
            var highestVersion = lookupResult.Major?.Identity?.Version;

            if (highestVersion == null)
            {
                return;
            }

            var allowing = lookupResult.AllowedChange == VersionChange.Major
                ? string.Empty
                : $" Allowing {lookupResult.AllowedChange} version updates.";

            var highestMatchVersion = lookupResult.Selected()?.Identity?.Version;

            var packageId = lookupResult.Major.Identity.Id;

            if (highestMatchVersion == null)
            {
                _logger.Normal($"Package {packageId} version {highestVersion} is available but is not allowed.{allowing}");
                return;
            }

            if (highestVersion > highestMatchVersion)
            {
                _logger.Normal($"Selected update of package {packageId} to version {highestMatchVersion}, but version {highestVersion} is also available.{allowing}");
            }
            else
            {
                _logger.Detailed($"Selected update of package {packageId} to highest version, {highestMatchVersion}.{allowing}");
            }
        }
Beispiel #2
0
        private void ProcessLookupResult(PackageLookupResult packageLookup, IDictionary <string, PackageLookupResult> result)
        {
            var selectedVersion = packageLookup.Selected();

            if (selectedVersion?.Identity?.Version != null)
            {
                _lookupReporter.Report(packageLookup);
                var packageId = selectedVersion.Identity.Id;
                result.Add(packageId, packageLookup);
            }
        }