From 6e08462fd5b811d545eedac92f1b861326c6e82f Mon Sep 17 00:00:00 2001 From: Steffen Forkmann Date: Sat, 13 May 2017 11:19:47 +0200 Subject: [PATCH] Small cleanup --- .../Installation/DependencyChangeDetection.fs | 4 +++- src/Paket.Core/Installation/RestoreProcess.fs | 4 +++- src/Paket.Core/PaketConfigFiles/LockFile.fs | 16 +++++++--------- src/Paket/Paket.fsproj | 2 +- 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/Paket.Core/Installation/DependencyChangeDetection.fs b/src/Paket.Core/Installation/DependencyChangeDetection.fs index 3d99e9e39b..0b7aa73be2 100644 --- a/src/Paket.Core/Installation/DependencyChangeDetection.fs +++ b/src/Paket.Core/Installation/DependencyChangeDetection.fs @@ -86,7 +86,9 @@ let findNuGetChangesInDependenciesFile(dependenciesFile:DependenciesFile,lockFil | _ -> yield groupName, name, [PackageNotFoundInDependenciesFile] // Removed ] |> List.filter (fun (_,_, changes) -> changes.Length > 0) - |> List.map (fun (g,p, changes) -> lockFile.GetAllNormalizedDependenciesOf(g,p,lockFile.FileName) |> Seq.map (fun (a,b) -> a,b,changes)) + |> List.map (fun (g,p, changes) -> + lockFile.GetAllNormalizedDependenciesOf(g,p,lockFile.FileName) + |> Seq.map (fun (a,b) -> a,b,changes)) |> Seq.concat |> Set.ofSeq diff --git a/src/Paket.Core/Installation/RestoreProcess.fs b/src/Paket.Core/Installation/RestoreProcess.fs index 268a6a0009..77ee846b85 100644 --- a/src/Paket.Core/Installation/RestoreProcess.fs +++ b/src/Paket.Core/Installation/RestoreProcess.fs @@ -212,7 +212,9 @@ let Restore(dependenciesFileName,projectFile,force,group,referencesFileNames,ign if hasAnyChanges then checkResponse "paket.dependencies and paket.lock are out of sync in %s.%sPlease run 'paket install' or 'paket update' to recompute the paket.lock file." lockFileName.Directory.FullName Environment.NewLine for (group, package, changes) in nugetChanges do - traceWarnfn "Changes %A were detected in %s/%s" changes (group.ToString()) (package.ToString()) + traceWarnfn "Changes were detected for %s/%s" (group.ToString()) (package.ToString()) + for change in changes do + traceWarnfn " - %A" change let groups = match group with diff --git a/src/Paket.Core/PaketConfigFiles/LockFile.fs b/src/Paket.Core/PaketConfigFiles/LockFile.fs index 41b356ba93..4d7b011810 100644 --- a/src/Paket.Core/PaketConfigFiles/LockFile.fs +++ b/src/Paket.Core/PaketConfigFiles/LockFile.fs @@ -644,24 +644,22 @@ type LockFile (fileName:string, groups: Map) = member __.GetTransitiveDependencies(groupName) = let collectDependenciesForGroup group = let fromNuGets = - group.Resolution - |> Seq.map (fun d -> d.Value.Dependencies |> Seq.map (fun (n,_,_) -> n)) - |> Seq.concat + group.Resolution + |> Seq.collect (fun d -> + d.Value.Dependencies + |> Seq.map (fun (n,_,_) -> n)) |> Set.ofSeq let fromSourceFiles = group.RemoteFiles - |> Seq.map (fun d -> d.Dependencies |> Seq.map fst) - |> Seq.concat + |> Seq.collect (fun d -> d.Dependencies |> Seq.map fst) |> Set.ofSeq Set.union fromNuGets fromSourceFiles - - let group = groups.TryFind groupName - match group with + + match groups.TryFind groupName with | None -> Set.empty | Some group -> collectDependenciesForGroup group - member this.GetTopLevelDependencies(groupName) = match groups |> Map.tryFind groupName with diff --git a/src/Paket/Paket.fsproj b/src/Paket/Paket.fsproj index 1e6e8ba800..decaef4f79 100644 --- a/src/Paket/Paket.fsproj +++ b/src/Paket/Paket.fsproj @@ -30,7 +30,7 @@ Project paket.exe Project - restore --target-framework netstandard1.3 --project "C:\temp\PaketRepro\PaketRepro\PaketRepro.csproj" + restore C:\temp\PaketRepro