From 0a4a39206bdf276b3ebffde9d1c8df314bffc970 Mon Sep 17 00:00:00 2001 From: Steffen Forkmann Date: Tue, 11 Jul 2017 13:57:17 +0200 Subject: [PATCH] Better tracing around download link - refernces #2508 --- RELEASE_NOTES.md | 3 +++ src/Paket.Core/Dependencies/NuGet.fs | 11 +++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 242a423a31..bb5e0d27e7 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,3 +1,6 @@ +#### 5.6.5 - 11.07.2017 +* BUGFIX: Better tracing around download link - https://github.com/fsprojects/Paket/issues/2508 + #### 5.6.4 - 11.07.2017 * BUGFIX: Work around Proget perf issue - https://github.com/fsprojects/Paket/issues/2466 diff --git a/src/Paket.Core/Dependencies/NuGet.fs b/src/Paket.Core/Dependencies/NuGet.fs index 4ccc18d4e0..aa363804c2 100644 --- a/src/Paket.Core/Dependencies/NuGet.fs +++ b/src/Paket.Core/Dependencies/NuGet.fs @@ -564,18 +564,25 @@ let DownloadPackage(alternativeProjectRoot, root, (source : PackageSource), cach let downloadUrl = ref "" try if authenticated then - tracefn "Downloading %O %O%s" packageName version (if groupName = Constants.MainDependencyGroup then "" else sprintf " (%O)" groupName) + let group = if groupName = Constants.MainDependencyGroup then "" else sprintf " (%O)" groupName + tracefn "Downloading %O %O%s" packageName version group + let! nugetPackage = GetPackageDetails alternativeProjectRoot root force [source] groupName packageName version let encodeURL (url:string) = url.Replace("+","%2B") let downloadUri = if Uri.IsWellFormedUriString(nugetPackage.DownloadLink, UriKind.Absolute) then + if verbose then + printfn "Downloading directly from DownloadLink: %s" nugetPackage.DownloadLink Uri nugetPackage.DownloadLink else let sourceUrl = if nugetPackage.Source.Url.EndsWith("/") then nugetPackage.Source.Url else nugetPackage.Source.Url + "/" - Uri(Uri sourceUrl, nugetPackage.DownloadLink) + let uri = Uri(Uri sourceUrl, nugetPackage.DownloadLink) + if verbose then + printfn "Downloading with combined url. Source: %s DownloadLink: %s Combined: %s" sourceUrl nugetPackage.DownloadLink (uri.ToString()) + uri downloadUrl := downloadUri.ToString()