From 849701c96079d3cf17dc09424ee1666960e618c2 Mon Sep 17 00:00:00 2001 From: Marcio Rinaldi Date: Wed, 19 Aug 2015 15:55:50 -0300 Subject: [PATCH] Warns when package is pinned --- src/Paket.Core/PackageResolver.fs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/Paket.Core/PackageResolver.fs b/src/Paket.Core/PackageResolver.fs index a2e6fc90ba..21092383ed 100644 --- a/src/Paket.Core/PackageResolver.fs +++ b/src/Paket.Core/PackageResolver.fs @@ -223,6 +223,25 @@ let Resolve(getVersionsF, getPackageDetailsF, globalFrameworkRestrictions, rootD package | _ -> package | false,_ -> + let warnPinned v = + match v with + | Some v -> traceWarnfn " %O is pinned to version %O" dependency.Name v + | None -> () + let getPinnedVersion d = + match d.Parent with + | DependenciesFile _ -> + match d.VersionRequirement.Range with + | Specific v -> Some v + | OverrideAll v -> Some v + | _ -> None + | Package _ -> None + requirements + |> Set.filter (fun r -> NormalizedPackageName dependency.Name = NormalizedPackageName r.Name) + |> Set.map getPinnedVersion + |> Seq.choose id + |> Seq.tryHead + |> warnPinned + tracefn " - %s %A" name version let packageDetails : PackageDetails = getPackageDetailsF dependency.Sources dependency.Name version let restrictedDependencies = DependencySetFilter.filterByRestrictions (dependency.Settings.FrameworkRestrictions @ globalFrameworkRestrictions) packageDetails.DirectDependencies