From d5c76fe877610fb9c6cb240df9bf992ce330cdaf Mon Sep 17 00:00:00 2001 From: mavnn Date: Tue, 24 Feb 2015 17:05:39 +0000 Subject: [PATCH 1/2] Handle transient dependencies better in pack command --- src/Paket.Core/PackageMetaData.fs | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/Paket.Core/PackageMetaData.fs b/src/Paket.Core/PackageMetaData.fs index 564d1b0122..c7e13f8be6 100644 --- a/src/Paket.Core/PackageMetaData.fs +++ b/src/Paket.Core/PackageMetaData.fs @@ -171,13 +171,27 @@ let findDependencies (dependencies : DependenciesFile) config (template : Templa let withDepsAndIncluded = files |> List.fold (fun templatefile file -> addFile (toFile config file) targetDir templatefile) withDeps - + + let locked = + (dependencies.FindLockfile().FullName + |> LockFile.LoadFrom).ResolvedPackages + // Add any paket references let referenceFile = ProjectFile.FindReferencesFile <| FileInfo project.FileName |> Option.map (ReferencesFile.FromFile) match referenceFile with | Some r -> r.NugetPackages - |> List.map (fun np -> np.Name.Id, dependencies.DirectDependencies.[np.Name]) + |> List.map (fun np -> + let dep = + match Map.tryFind np.Name dependencies.DirectDependencies with + | Some direct -> direct + // If it's a transiant dependency set + // min version to current locked version + | None -> + let resolved = + locked |> Map.find (NormalizedPackageName np.Name) + VersionRequirement(Minimum resolved.Version, PreReleaseStatus.All) + np.Name.Id, dep) |> List.fold addDependency withDepsAndIncluded | None -> withDepsAndIncluded From 6e1159cc7b4d7e800fa8440526a5aefaef40ec06 Mon Sep 17 00:00:00 2001 From: mavnn Date: Tue, 24 Feb 2015 17:12:56 +0000 Subject: [PATCH 2/2] Fix typo --- src/Paket.Core/PackageMetaData.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Paket.Core/PackageMetaData.fs b/src/Paket.Core/PackageMetaData.fs index c7e13f8be6..4c3efabfdc 100644 --- a/src/Paket.Core/PackageMetaData.fs +++ b/src/Paket.Core/PackageMetaData.fs @@ -186,7 +186,7 @@ let findDependencies (dependencies : DependenciesFile) config (template : Templa let dep = match Map.tryFind np.Name dependencies.DirectDependencies with | Some direct -> direct - // If it's a transiant dependency set + // If it's a transient dependency set // min version to current locked version | None -> let resolved =