diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 40eeaa36cd..be4dab06c2 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,3 +1,6 @@ +#### 2.66.6 - 31.05.2016 +* BUGFIX: Groups with different sources should not resolve to wrong packages - https://github.com/fsprojects/Paket/issues/1711 + #### 2.66.5 - 30.05.2016 * BUGFIX: Don't remove trailing zero if version is in package path - https://github.com/fsprojects/Paket/issues/1708 diff --git a/integrationtests/Paket.IntegrationTests/UpdateGroupsSpecs.fs b/integrationtests/Paket.IntegrationTests/UpdateGroupsSpecs.fs index e8b05e1b81..9db9e1c4f9 100644 --- a/integrationtests/Paket.IntegrationTests/UpdateGroupsSpecs.fs +++ b/integrationtests/Paket.IntegrationTests/UpdateGroupsSpecs.fs @@ -30,4 +30,24 @@ let ``#1018 update group legacy``() = lockFile.Groups.[Constants.MainDependencyGroup].Resolution.[PackageName "NUnit"].Version |> shouldEqual (SemVer.Parse "2.6.1") lockFile.Groups.[GroupName "Legacy"].Resolution.[PackageName "Newtonsoft.Json"].Version - |> shouldBeGreaterThan (SemVer.Parse "5.0.2") \ No newline at end of file + |> shouldBeGreaterThan (SemVer.Parse "5.0.2") + +[] +let ``#1711 update main group with correct source``() = + update "i001711-wrong-source" |> ignore + let lockFile = LockFile.LoadFrom(Path.Combine(scenarioTempPath "i001711-wrong-source","paket.lock")) + let p1 = lockFile.Groups.[Constants.MainDependencyGroup].Resolution.[PackageName "Test"] + p1.Version |> shouldEqual (SemVer.Parse "0.0.1") + p1.Source.Url |> shouldEqual "TestA" + +[] +let ``#1711 update main group with correct source with multiple groups``() = + update "i001711-wrong-groupsource" |> ignore + let lockFile = LockFile.LoadFrom(Path.Combine(scenarioTempPath "i001711-wrong-groupsource","paket.lock")) + let p1 = lockFile.Groups.[Constants.MainDependencyGroup].Resolution.[PackageName "Test"] + p1.Version |> shouldEqual (SemVer.Parse "0.0.1") + p1.Source.Url |> shouldEqual "TestA" + + let p2 = lockFile.Groups.[GroupName "Cumulus.1.0"].Resolution.[PackageName "Test"] + p2.Version |> shouldEqual (SemVer.Parse "0.0.1") + p2.Source.Url |> shouldEqual "TestB" \ No newline at end of file diff --git a/integrationtests/scenarios/i001711-wrong-groupsource/before/TestA/Test.0.0.1.nupkg b/integrationtests/scenarios/i001711-wrong-groupsource/before/TestA/Test.0.0.1.nupkg new file mode 100644 index 0000000000..865a500de2 Binary files /dev/null and b/integrationtests/scenarios/i001711-wrong-groupsource/before/TestA/Test.0.0.1.nupkg differ diff --git a/integrationtests/scenarios/i001711-wrong-groupsource/before/TestB/Test.0.0.1.nupkg b/integrationtests/scenarios/i001711-wrong-groupsource/before/TestB/Test.0.0.1.nupkg new file mode 100644 index 0000000000..14ba385e03 Binary files /dev/null and b/integrationtests/scenarios/i001711-wrong-groupsource/before/TestB/Test.0.0.1.nupkg differ diff --git a/integrationtests/scenarios/i001711-wrong-groupsource/before/paket.dependencies b/integrationtests/scenarios/i001711-wrong-groupsource/before/paket.dependencies new file mode 100644 index 0000000000..4cec4a9b7f --- /dev/null +++ b/integrationtests/scenarios/i001711-wrong-groupsource/before/paket.dependencies @@ -0,0 +1,6 @@ +source TestA +nuget Test + +group Cumulus.1.0 + source TestB + nuget Test diff --git a/integrationtests/scenarios/i001711-wrong-source/before/TestA/Test.0.0.1.nupkg b/integrationtests/scenarios/i001711-wrong-source/before/TestA/Test.0.0.1.nupkg new file mode 100644 index 0000000000..865a500de2 Binary files /dev/null and b/integrationtests/scenarios/i001711-wrong-source/before/TestA/Test.0.0.1.nupkg differ diff --git a/integrationtests/scenarios/i001711-wrong-source/before/TestB/Test.0.0.1.nupkg b/integrationtests/scenarios/i001711-wrong-source/before/TestB/Test.0.0.1.nupkg new file mode 100644 index 0000000000..14ba385e03 Binary files /dev/null and b/integrationtests/scenarios/i001711-wrong-source/before/TestB/Test.0.0.1.nupkg differ diff --git a/integrationtests/scenarios/i001711-wrong-source/before/paket.dependencies b/integrationtests/scenarios/i001711-wrong-source/before/paket.dependencies new file mode 100644 index 0000000000..635286ed2c --- /dev/null +++ b/integrationtests/scenarios/i001711-wrong-source/before/paket.dependencies @@ -0,0 +1,2 @@ +source TestA +nuget Test \ No newline at end of file diff --git a/src/Paket.Core/UpdateProcess.fs b/src/Paket.Core/UpdateProcess.fs index 7439fd93dc..169898435a 100644 --- a/src/Paket.Core/UpdateProcess.fs +++ b/src/Paket.Core/UpdateProcess.fs @@ -10,9 +10,10 @@ open Chessie.ErrorHandling open Paket.Logging let selectiveUpdate force getSha1 getSortedVersionsF getPackageDetailsF (lockFile:LockFile) (dependenciesFile:DependenciesFile) updateMode semVerUpdateMode = - let allVersions = Dictionary() + let allVersions = Dictionary() let getSortedAndCachedVersionsF sources resolverStrategy groupName packageName : seq = - match allVersions.TryGetValue(packageName) with + let key = packageName,sources + match allVersions.TryGetValue key with | false,_ -> let versions = verbosefn " - fetching versions for %O" packageName @@ -20,7 +21,7 @@ let selectiveUpdate force getSha1 getSortedVersionsF getPackageDetailsF (lockFil if Seq.isEmpty versions then failwithf "Couldn't retrieve versions for %O." packageName - allVersions.Add(packageName,versions) + allVersions.Add(key,versions) versions | true,versions -> versions |> List.toSeq diff --git a/src/Paket/Paket.fsproj b/src/Paket/Paket.fsproj index 6514da7fd1..00253f110a 100644 --- a/src/Paket/Paket.fsproj +++ b/src/Paket/Paket.fsproj @@ -50,8 +50,8 @@ D:\code\PaketKopie update -f D:\code\Paket\integrationtests\scenarios\i001117-aws\temp - install - D:\code\PaketWithXUnit + update + D:\code\Paket\integrationtests\scenarios\i001711-wrong-groupsource\temp 11