Skip to content

Commit

Permalink
Try to fix dates in Nuget packages - relates to #761
Browse files Browse the repository at this point in the history
  • Loading branch information
forki committed Apr 9, 2015
1 parent 2d5bce2 commit c5a0ce0
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
3 changes: 3 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#### 0.39.3 - 10.04.2015
* Try to fix dates in Nuget packages - https://github.com/fsprojects/Paket/issues/761

#### 0.39.2 - 09.04.2015
* Allow . in target file names for pack - https://github.com/fsprojects/Paket/issues/756

Expand Down
12 changes: 12 additions & 0 deletions src/Paket.Core/NuGetV2.fs
Original file line number Diff line number Diff line change
Expand Up @@ -332,13 +332,25 @@ let inline isExtracted fileName =
di.EnumerateFileSystemInfos()
|> Seq.exists (fun f -> f.FullName <> fi.FullName)

let fixDatesInArchive fileName =
use archive = ZipFile.Open(fileName,ZipArchiveMode.Update)
for e in archive.Entries do
try
let d = e.LastWriteTime
()
with
| xn -> e.LastWriteTime <- DateTimeOffset.Now


/// Extracts the given package to the ./packages folder
let ExtractPackage(fileName:string, targetFolder, name, version:SemVerInfo) =
async {
if isExtracted fileName then
verbosefn "%s %A already extracted" name version
else
Directory.CreateDirectory(targetFolder) |> ignore

fixDatesInArchive fileName
ZipFile.ExtractToDirectory(fileName, targetFolder)

// cleanup folder structure
Expand Down
6 changes: 2 additions & 4 deletions src/Paket/Paket.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,10 @@
<StartProgram>paket.exe</StartProgram>
<StartWorkingDirectory>D:\code\Pakettest</StartWorkingDirectory>
<StartWorkingDirectory>D:\code\Paketkopie</StartWorkingDirectory>
<StartArguments>pack output ./temp version 0.37.0 releaseNotes "Fallback
to NuGet.exe if the bootstrapper fails to download from GitHub - https://github.com/fsprojects/Paket/pull/733
COSMETICS: Display the file name if Paket crashes on some invalid file - https://github.com/fsprojects/Paket/pull/730"</StartArguments>
<StartArguments>update</StartArguments>
<StartAction>Project</StartAction>
<StartProgram>paket.exe</StartProgram>
<StartWorkingDirectory>D:\code\Paket</StartWorkingDirectory>
<StartWorkingDirectory>D:\code\Pakettest</StartWorkingDirectory>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
Expand Down

0 comments on commit c5a0ce0

Please sign in to comment.