From b212126ea9673cfff68a186a67bf416a76df358d Mon Sep 17 00:00:00 2001 From: Erick Yondon Date: Tue, 12 Jan 2021 16:02:05 -0800 Subject: [PATCH] Address code review comments by Andy for deterministic packing. --- .../PackageCreation/Authoring/PackageBuilder.cs | 4 ++-- src/NuGet.Core/NuGet.Packaging/Strings.Designer.cs | 2 +- src/NuGet.Core/NuGet.Packaging/Strings.resx | 8 +++++--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/NuGet.Core/NuGet.Packaging/PackageCreation/Authoring/PackageBuilder.cs b/src/NuGet.Core/NuGet.Packaging/PackageCreation/Authoring/PackageBuilder.cs index df83727e75d..978be117c08 100644 --- a/src/NuGet.Core/NuGet.Packaging/PackageCreation/Authoring/PackageBuilder.cs +++ b/src/NuGet.Core/NuGet.Packaging/PackageCreation/Authoring/PackageBuilder.cs @@ -926,7 +926,7 @@ private ZipArchiveEntry CreatePackageFileEntry(ZipArchive package, string entryN PackagingLogMessage.CreateMessage( string.Format( CultureInfo.CurrentCulture, - Strings.ZipFileTimeStampModified, entryName, timeOffset.DateTime.ToShortDateString(), ZipFormatMinDate.ToShortDateString()), + Strings.ZipFileTimeStampModified, entryName, timeOffset.DateTime.ToShortDateString(), ZipFormatMinDate.ToShortDateString(), ZipFormatMinDate.ToShortDateString(), ZipFormatMaxDate.ToShortDateString()), LogLevel.Information)); } @@ -942,7 +942,7 @@ private ZipArchiveEntry CreatePackageFileEntry(ZipArchive package, string entryN PackagingLogMessage.CreateMessage( string.Format( CultureInfo.CurrentCulture, - Strings.ZipFileTimeStampModified, entryName, timeOffset.DateTime.ToShortDateString(), ZipFormatMinDate.ToShortDateString()), + Strings.ZipFileTimeStampModified, entryName, timeOffset.DateTime.ToShortDateString(), ZipFormatMinDate.ToShortDateString(), ZipFormatMinDate.ToShortDateString(), ZipFormatMaxDate.ToShortDateString()), LogLevel.Information)); } diff --git a/src/NuGet.Core/NuGet.Packaging/Strings.Designer.cs b/src/NuGet.Core/NuGet.Packaging/Strings.Designer.cs index 3a2326281a5..4887d034d59 100644 --- a/src/NuGet.Core/NuGet.Packaging/Strings.Designer.cs +++ b/src/NuGet.Core/NuGet.Packaging/Strings.Designer.cs @@ -1960,7 +1960,7 @@ internal class Strings { } /// - /// Looks up a localized string similar to Last write timestamp for '{0}' changed from '{1}' to '{2}' because the zip file format does not support timestamp values before 01/01/1980 or after 12/31/2107.. + /// Looks up a localized string similar to Last write timestamp for '{0}' changed from '{1}' to '{2}' because the zip file format does not support timestamp values before {3} or after {4}.. /// internal static string ZipFileTimeStampModified { get { diff --git a/src/NuGet.Core/NuGet.Packaging/Strings.resx b/src/NuGet.Core/NuGet.Packaging/Strings.resx index c692b7faef3..977bfb754a4 100644 --- a/src/NuGet.Core/NuGet.Packaging/Strings.resx +++ b/src/NuGet.Core/NuGet.Packaging/Strings.resx @@ -864,9 +864,11 @@ Valid from: 0 - property name - Last write timestamp for '{0}' changed from '{1}' to '{2}' because the zip file format does not support timestamp values before 01/01/1980 or after 12/31/2107. + Last write timestamp for '{0}' changed from '{1}' to '{2}' because the zip file format does not support timestamp values before {3} or after {4}. 0 - Entry name 1 - original modified timestamp -2 - new modified timestamp +2 - new modified timestamp +3 - Earliest date zip file supports +4 - Latest date zip file supports - + \ No newline at end of file