Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only fixup dates in zip archive under Mono #1094

Merged
merged 1 commit into from
Sep 28, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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