Skip to content

Commit

Permalink
Fixed out-of-date check for packages - fixes #1766
Browse files Browse the repository at this point in the history
  • Loading branch information
forki committed Jun 28, 2016
1 parent a4d1039 commit 1362dd0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
4 changes: 2 additions & 2 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#### 3.3.5 - 27.06.2016
* BUGFIX: Fixed out-of-date check for remote files - https://github.com/fsprojects/Paket/issues/1760, https://github.com/fsprojects/Paket/issues/1762
#### 3.3.6 - 28.06.2016
* BUGFIX: Fixed out-of-date check for remote files - https://github.com/fsprojects/Paket/issues/1760, https://github.com/fsprojects/Paket/issues/1762, https://github.com/fsprojects/Paket/issues/1766

#### 3.3.3 - 27.06.2016
* USABILITY: Show out-of-sync warning message if paket.lock is not matching paket.dependencies - https://github.com/fsprojects/Paket/issues/1750
Expand Down
20 changes: 14 additions & 6 deletions src/Paket.Core/DependencyChangeDetection.fs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
open Paket.Domain
open Paket.Requirements
open Paket.PackageResolver
open Logging

let findNuGetChangesInDependenciesFile(dependenciesFile:DependenciesFile,lockFile:LockFile,strict) =
let allTransitives groupName = lockFile.GetTransitiveDependencies groupName
Expand All @@ -28,13 +29,16 @@ let findNuGetChangesInDependenciesFile(dependenciesFile:DependenciesFile,lockFil
| Some group ->
let lockFileGroup = lockFile.Groups |> Map.tryFind groupName
group.Packages
|> Seq.map (fun d -> d.Name,d)
|> Seq.filter (fun (name,pr) ->
|> Seq.map (fun d ->
d.Name, { d with Settings = group.Options.Settings + d.Settings })
|> Seq.filter (fun (name,dependenciesFilePackage) ->
match lockFileGroup with
| None -> true
| Some group ->
match group.Resolution.TryFind name with
| Some p -> hasChanged groupName transitives pr p
| Some lockFilePackage ->
let p' = { lockFilePackage with Settings = group.Options.Settings + lockFilePackage.Settings }
hasChanged groupName transitives dependenciesFilePackage p'
| _ -> true)
|> Seq.map (fun (p,_) -> groupName,p)
|> Set.ofSeq
Expand All @@ -45,13 +49,17 @@ let findNuGetChangesInDependenciesFile(dependenciesFile:DependenciesFile,lockFil
| None -> Map.empty
| Some group ->
group.Packages
|> Seq.map (fun d -> d.Name,d)
|> Seq.map (fun d -> d.Name,{ d with Settings = group.Options.Settings + d.Settings })
|> Map.ofSeq

[for t in lockFile.GetTopLevelDependencies(groupName) do
[for t in lockFile.GetTopLevelDependencies(groupName) do
let name = t.Key
match directMap.TryFind name with
| Some pr -> if hasChanged groupName transitives pr t.Value then yield groupName, name // Modified
| Some pr ->
let t = t.Value
let t = { t with Settings = lockFile.GetGroup(groupName).Options.Settings + t.Settings }
if hasChanged groupName transitives pr t then
yield groupName, name // Modified
| _ -> yield groupName, name // Removed
]
|> List.map lockFile.GetAllNormalizedDependenciesOf
Expand Down

1 comment on commit 1362dd0

@konste
Copy link
Contributor

@konste konste commented on 1362dd0 Jun 28, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Please sign in to comment.