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

fix NuGet.Core issue in OptimizedZipPackage #35

Open
wants to merge 2 commits into
base: 2.11
Choose a base branch
from
Open
Show file tree
Hide file tree
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
10 changes: 5 additions & 5 deletions src/Core/Authoring/PackageBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ public void Save(Stream stream)
WriteManifest(package, DetermineMinimumSchemaVersion(Files, DependencySets));

// Write the files to the package
WriteFiles(package);
WriteFiles(package, Id);

// Copy the metadata properties back to the package
package.PackageProperties.Creator = String.Join(",", Authors);
Expand Down Expand Up @@ -484,7 +484,7 @@ private void WriteManifest(Package package, int minimumManifestVersion)
}
}

private void WriteFiles(Package package)
private void WriteFiles(Package package, string packageId)
{
// Add files that might not come from expanding files on disk
foreach (IPackageFile file in new HashSet<IPackageFile>(Files))
Expand All @@ -493,7 +493,7 @@ private void WriteFiles(Package package)
{
try
{
CreatePart(package, file.Path, stream);
CreatePart(package, file.Path, stream, packageId);
}
catch
{
Expand Down Expand Up @@ -592,9 +592,9 @@ private static void ExcludeFiles(List<PhysicalPackageFile> searchFiles, string b
}
}

private static void CreatePart(Package package, string path, Stream sourceStream)
private static void CreatePart(Package package, string path, Stream sourceStream, string packageId)
{
if (PackageHelper.IsPackageManifest(path, package.PackageProperties.Identifier))
if (PackageHelper.IsPackageManifest(path, packageId))
{
return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Core/Packages/OptimizedZipPackage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ private void EnsurePackageFiles()
Package package = Package.Open(stream);
// unzip files inside package
var files = from part in package.GetParts()
where ZipPackage.IsPackageFile(part, package.PackageProperties.Identifier)
where ZipPackage.IsPackageFile(part, Id)
select part;

// now copy all package's files to disk
Expand Down