From 493949f0d6cce8b6439e3fd148a5bb9d37c6a844 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 | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/Paket.Core/PackageResolver.fs b/src/Paket.Core/PackageResolver.fs index a2e6fc90ba..8f10970eb7 100644 --- a/src/Paket.Core/PackageResolver.fs +++ b/src/Paket.Core/PackageResolver.fs @@ -222,7 +222,22 @@ let Resolve(getVersionsF, getPackageDetailsF, globalFrameworkRestrictions, rootD exploredPackages.[(normalizedPackageName,version)] <- package package | _ -> package - | false,_ -> + | false,_ -> + 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 + |> Option.iter (traceWarnfn " %O is pinned to version %O" dependency.Name) + tracefn " - %s %A" name version let packageDetails : PackageDetails = getPackageDetailsF dependency.Sources dependency.Name version let restrictedDependencies = DependencySetFilter.filterByRestrictions (dependency.Settings.FrameworkRestrictions @ globalFrameworkRestrictions) packageDetails.DirectDependencies