Skip to content

Commit

Permalink
Warns when package is pinned
Browse files Browse the repository at this point in the history
  • Loading branch information
mrinaldi committed Aug 19, 2015
1 parent c7aadd6 commit 849701c
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/Paket.Core/PackageResolver.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 849701c

Please sign in to comment.