Skip to content

Commit

Permalink
Merge pull request #1094 from rjnilsson/no-fixarchive-unless-mono
Browse files Browse the repository at this point in the history
Only fixup dates in zip archive under Mono
  • Loading branch information
forki committed Sep 28, 2015
2 parents f43055c + 45a7dcb commit 356f7b8
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/Paket.Core/NuGetV2.fs
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ let getDetailsFromNuGet force auth nugetURL (packageName:PackageName) (version:S
raise exn
return! getDetailsFromNuGetViaOData auth nugetURL packageName version
}

let fixDatesInArchive fileName =
try
use zipToOpen = new FileStream(fileName, FileMode.Open)
Expand All @@ -338,6 +338,9 @@ let fixDatesInArchive fileName =
with
| exn -> traceWarnfn "Could not fix timestamps in %s. Error: %s" fileName exn.Message

let fixArchive fileName =
if isMonoRuntime then fixDatesInArchive fileName

let findLocalPackage directory (packageName:PackageName) (version:SemVerInfo) =
let v1 = FileInfo(Path.Combine(directory, sprintf "%O.%O.nupkg" packageName version))
if v1.Exists then v1 else
Expand All @@ -363,7 +366,7 @@ let getDetailsFromLocalFile root localNugetPath (packageName:PackageName) (versi
let di = getDirectoryInfo localNugetPath root
let nupkg = findLocalPackage di.FullName packageName version

fixDatesInArchive nupkg.FullName
fixArchive nupkg.FullName
use zipToCreate = new FileStream(nupkg.FullName, FileMode.Open)
use zip = new ZipArchive(zipToCreate,ZipArchiveMode.Read)

Expand Down Expand Up @@ -402,7 +405,7 @@ let ExtractPackage(fileName:string, targetFolder, packageName:PackageName, versi
else
Directory.CreateDirectory(targetFolder) |> ignore

fixDatesInArchive fileName
fixArchive fileName
ZipFile.ExtractToDirectory(fileName, targetFolder)

// cleanup folder structure
Expand Down

0 comments on commit 356f7b8

Please sign in to comment.