Skip to content

Commit

Permalink
Establish beta-level compatibility with Klondike
Browse files Browse the repository at this point in the history
* Have the nuget v2 package details query fallback with /odata prefix
* Negotiate XML content type on /odata prefixed calls
  • Loading branch information
ilkerde committed Jun 28, 2015
1 parent 5ed8ae8 commit 13a1265
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 17 deletions.
4 changes: 4 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#### 1.18.3
* Support Odata query fallback for package details with /odata prefix
* Establish beta-level comatibility with Klondike nuget server

#### 1.18.2 - 23.06.2015
* BUGFIX: Use updated globbing for paket.template

Expand Down
8 changes: 4 additions & 4 deletions src/Paket.Bootstrapper/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
[assembly: AssemblyTitleAttribute("Paket.Bootstrapper")]
[assembly: AssemblyProductAttribute("Paket")]
[assembly: AssemblyDescriptionAttribute("A package dependency manager for .NET with support for NuGet packages and GitHub repositories.")]
[assembly: AssemblyVersionAttribute("1.18.2")]
[assembly: AssemblyFileVersionAttribute("1.18.2")]
[assembly: AssemblyInformationalVersionAttribute("1.18.2")]
[assembly: AssemblyVersionAttribute("1.18.3")]
[assembly: AssemblyFileVersionAttribute("1.18.3")]
[assembly: AssemblyInformationalVersionAttribute("1.18.3")]
namespace System {
internal static class AssemblyVersionInformation {
internal const string Version = "1.18.2";
internal const string Version = "1.18.3";
}
}
8 changes: 4 additions & 4 deletions src/Paket.Core/AssemblyInfo.fs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ open System.Reflection
[<assembly: AssemblyProductAttribute("Paket")>]
[<assembly: AssemblyCompanyAttribute("Paket team")>]
[<assembly: AssemblyDescriptionAttribute("A package dependency manager for .NET with support for NuGet packages and GitHub repositories.")>]
[<assembly: AssemblyVersionAttribute("1.18.2")>]
[<assembly: AssemblyFileVersionAttribute("1.18.2")>]
[<assembly: AssemblyInformationalVersionAttribute("1.18.2")>]
[<assembly: AssemblyVersionAttribute("1.18.3")>]
[<assembly: AssemblyFileVersionAttribute("1.18.3")>]
[<assembly: AssemblyInformationalVersionAttribute("1.18.3")>]
do ()

module internal AssemblyVersionInformation =
let [<Literal>] Version = "1.18.2"
let [<Literal>] Version = "1.18.3"
10 changes: 9 additions & 1 deletion src/Paket.Core/NuGetV2.fs
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,15 @@ let getDetailsFromNuGetViaOData auth nugetURL package (version:SemVerInfo) =
return! getDetailsFromNuGetViaODataFast auth nugetURL package version
with _ ->
let url = sprintf "%s/Packages(Id='%s',Version='%s')" nugetURL package (version.ToString())
let! raw = getFromUrl(auth,url)
let! response = safeGetFromUrl(auth,url)

let! raw =
match response with
| Some(r) -> async { return r }
| None ->
let url = sprintf "%s/odata/Packages(Id='%s',Version='%s')" nugetURL package (version.ToString())
getXmlFromUrl(auth,url)

if verbose then
tracefn "Response from %s:" url
tracefn ""
Expand Down
18 changes: 18 additions & 0 deletions src/Paket.Core/Utils.fs
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,24 @@ let getFromUrl (auth:Auth option, url : string) =
return ""
}

let getXmlFromUrl (auth:Auth option, url : string) =
async {
try
use client = createWebClient(url,auth)

// mimic the headers sent from nuget client to odata/ endpoints
client.Headers.Add(HttpRequestHeader.Accept, "application/atom+xml, application/xml")
client.Headers.Add(HttpRequestHeader.AcceptCharset, "UTF-8")
client.Headers.Add("DataServiceVersion", "1.0;NetFx")
client.Headers.Add("MaxDataServiceVersion", "2.0;NetFx")

return! client.AsyncDownloadString(Uri(url))
with
| exn ->
failwithf "Could not retrieve data from %s%s Message: %s" url Environment.NewLine exn.Message
return ""
}

/// [omit]
let safeGetFromUrl (auth:Auth option, url : string) =
async {
Expand Down
8 changes: 4 additions & 4 deletions src/Paket.PowerShell/AssemblyInfo.fs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ open System.Reflection
[<assembly: AssemblyProductAttribute("Paket")>]
[<assembly: AssemblyCompanyAttribute("Paket team")>]
[<assembly: AssemblyDescriptionAttribute("A package dependency manager for .NET with support for NuGet packages and GitHub repositories.")>]
[<assembly: AssemblyVersionAttribute("1.18.2")>]
[<assembly: AssemblyFileVersionAttribute("1.18.2")>]
[<assembly: AssemblyInformationalVersionAttribute("1.18.2")>]
[<assembly: AssemblyVersionAttribute("1.18.3")>]
[<assembly: AssemblyFileVersionAttribute("1.18.3")>]
[<assembly: AssemblyInformationalVersionAttribute("1.18.3")>]
do ()

module internal AssemblyVersionInformation =
let [<Literal>] Version = "1.18.2"
let [<Literal>] Version = "1.18.3"
8 changes: 4 additions & 4 deletions src/Paket/AssemblyInfo.fs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ open System.Reflection
[<assembly: AssemblyProductAttribute("Paket")>]
[<assembly: AssemblyCompanyAttribute("Paket team")>]
[<assembly: AssemblyDescriptionAttribute("A package dependency manager for .NET with support for NuGet packages and GitHub repositories.")>]
[<assembly: AssemblyVersionAttribute("1.18.2")>]
[<assembly: AssemblyFileVersionAttribute("1.18.2")>]
[<assembly: AssemblyInformationalVersionAttribute("1.18.2")>]
[<assembly: AssemblyVersionAttribute("1.18.3")>]
[<assembly: AssemblyFileVersionAttribute("1.18.3")>]
[<assembly: AssemblyInformationalVersionAttribute("1.18.3")>]
do ()

module internal AssemblyVersionInformation =
let [<Literal>] Version = "1.18.2"
let [<Literal>] Version = "1.18.3"

0 comments on commit 13a1265

Please sign in to comment.