Skip to content

Commit

Permalink
fix build full package filename comparison (#170)
Browse files Browse the repository at this point in the history
Co-authored-by: Markus Hütter <[email protected]>
  • Loading branch information
hutterm and hutterm authored Apr 27, 2021
1 parent 7b5b158 commit 0245aa9
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/Snap/Core/SnapPack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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(
Expand All @@ -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(
Expand Down Expand Up @@ -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)}");
Expand Down

0 comments on commit 0245aa9

Please sign in to comment.