From 0245aa97a2026f33e8ad15ac1db18053fcc4a0c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20H=C3=BCtter?= Date: Tue, 27 Apr 2021 16:27:16 +0200 Subject: [PATCH] fix build full package filename comparison (#170) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Markus Hütter --- src/Snap/Core/SnapPack.cs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/Snap/Core/SnapPack.cs b/src/Snap/Core/SnapPack.cs index 6eb0febd..6ecb9840 100644 --- a/src/Snap/Core/SnapPack.cs +++ b/src/Snap/Core/SnapPack.cs @@ -714,8 +714,7 @@ async Task ApplyDeltaPackageAsync(SnapRelease deltaRelease, bool skipChecksum = $"Target path: {checksumNuspecTargetPath}. " + $"Nupkg: {deltaRelease.Filename}."); } - - var existingFullChecksum = reassembledFullSnapRelease.Files.SingleOrDefault(x => x.NuspecTargetPath == checksumNuspecTargetPath); + var existingFullChecksum = reassembledFullSnapRelease.Files.SingleOrDefault(x => string.Equals(x.NuspecTargetPath, checksumNuspecTargetPath, StringComparison.OrdinalIgnoreCase)); if (existingFullChecksum == null) { throw new FileNotFoundException( @@ -739,7 +738,7 @@ async Task ApplyDeltaPackageAsync(SnapRelease deltaRelease, bool skipChecksum = } } - var existingFullChecksum = reassembledFullSnapRelease.Files.SingleOrDefault(x => x.NuspecTargetPath == deltaChecksum.NuspecTargetPath); + var existingFullChecksum = reassembledFullSnapRelease.Files.SingleOrDefault(x => string.Equals(x.NuspecTargetPath, deltaChecksum.NuspecTargetPath, StringComparison.OrdinalIgnoreCase) ); if (existingFullChecksum != null) { throw new Exception( @@ -754,8 +753,8 @@ async Task ApplyDeltaPackageAsync(SnapRelease deltaRelease, bool skipChecksum = } foreach (var deltaChecksum in deltaRelease.Modified) - { - var existingChecksum = reassembledFullSnapRelease.Files.SingleOrDefault(x => x.NuspecTargetPath == deltaChecksum.NuspecTargetPath); + { + var existingChecksum = reassembledFullSnapRelease.Files.SingleOrDefault(x => string.Equals(x.NuspecTargetPath, deltaChecksum.NuspecTargetPath, StringComparison.OrdinalIgnoreCase)); if (existingChecksum == null) { throw new Exception( @@ -1274,7 +1273,7 @@ void AddPackageFile([NotNull] PackageBuilder packageBuilder, [NotNull] Stream sr throw new Exception($"Failed to replace: {nuspecTargetPath}. It does not exist in {nameof(packageBuilder)}"); } - var existingSnapReleaseChecksum = snapRelease.Files.SingleOrDefault(x => x.NuspecTargetPath == nuspecTargetPath); + var existingSnapReleaseChecksum = snapRelease.Files.SingleOrDefault(x => string.Equals(x.NuspecTargetPath, nuspecTargetPath,StringComparison.OrdinalIgnoreCase)); if (existingSnapReleaseChecksum == null) { throw new Exception($"Failed to replace: {nuspecTargetPath}. It does not exist in {nameof(snapRelease)}");