Skip to content

Commit

Permalink
Lockfile-Parser did not to parse framework restrictions and therefore…
Browse files Browse the repository at this point in the history
… paket install could lead to wrong lock file - fixes #1135
  • Loading branch information
forki committed Oct 14, 2015
1 parent 5d304a9 commit 9a496c7
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
3 changes: 3 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#### 2.12.5 - 14.10.2015
* BUGFIX: Lockfile-Parser did not to parse framework restrictions and therefore paket install could lead to wrong lock file - https://github.com/fsprojects/Paket/issues/1135

#### 2.12.4 - 14.10.2015
* USABILITY: Non-SemVer InformationalVersion are now allowed for paket pack - https://github.com/fsprojects/Paket/issues/1134

Expand Down
7 changes: 4 additions & 3 deletions src/Paket.Core/LockFile.fs
Original file line number Diff line number Diff line change
Expand Up @@ -257,13 +257,14 @@ module LockFileParser =
| NugetDependency (name, v) ->
let parts = v.Split([|" - "|],StringSplitOptions.None)
let version = parts.[0]
if currentGroup.LastWasPackage then
let restrictions = if parts.Length <= 1 then [] else parseRestrictions parts.[1]
if currentGroup.LastWasPackage then
match currentGroup.Packages with
| currentPackage :: otherPackages ->
{ currentGroup with
Packages = { currentPackage with
Dependencies = Set.add (PackageName name, DependenciesFileParser.parseVersionRequirement version, []) currentPackage.Dependencies
} :: otherPackages } ::otherGroups
Dependencies = Set.add (PackageName name, DependenciesFileParser.parseVersionRequirement version, restrictions) currentPackage.Dependencies
} :: otherPackages } ::otherGroups
| [] -> failwithf "cannot set a dependency to %s %s - no package has been specified." name v
else
match currentGroup.SourceFiles with
Expand Down
2 changes: 1 addition & 1 deletion src/Paket.Core/Requirements.fs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type FrameworkRestriction =
| Between of FrameworkIdentifier * FrameworkIdentifier

override this.ToString() =
match this with
match this with
| FrameworkRestriction.Exactly r -> r.ToString()
| FrameworkRestriction.Portable r -> r
| FrameworkRestriction.AtLeast r -> ">= " + r.ToString()
Expand Down
4 changes: 2 additions & 2 deletions src/Paket/Paket.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@
<StartArguments>update group Build</StartArguments>
<StartArguments>pack output D:\code\paketbug\output</StartArguments>
<StartArguments>install</StartArguments>
<StartArguments>update</StartArguments>
<StartArguments>install</StartArguments>
<StartAction>Project</StartAction>
<StartProgram>paket.exe</StartProgram>
<StartWorkingDirectory>c:\code\Paketkopie</StartWorkingDirectory>
<StartWorkingDirectory>C:\Temp\paket_test\</StartWorkingDirectory>
<StartWorkingDirectory>d:\code\paketkopie</StartWorkingDirectory>
<StartWorkingDirectory>d:\code\paketbug</StartWorkingDirectory>
<StartWorkingDirectory>d:\code\paketrepro</StartWorkingDirectory>
<StartWorkingDirectory>d:\code\FsReveal</StartWorkingDirectory>
<StartWorkingDirectory>d:\code\paketrepro4</StartWorkingDirectory>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
Expand Down

0 comments on commit 9a496c7

Please sign in to comment.