Skip to content

Latest commit

 

History

History
34 lines (21 loc) · 1.57 KB

delta-packages.md

File metadata and controls

34 lines (21 loc) · 1.57 KB
docs / using / delta-packages.md

Delta Packages

Now, once we've got a full package, we need to generate a Delta package. To do this, we'll replace all the DLL/EXEs in the NuGet packages with bsdiff files. bspatch/bsdiff is a mostly efficient algorithm for calculating diffs between binary files (especially Native binaries, but it works well for .NET ones too), and a way to apply them.

So, this is pretty easy:

  1. Extract the previous NuGet package
  2. Extract the current NuGet package
  3. Replace every EXE/DLL with the bsdiff. So, lib\net40\MyCoolApp.exe becomes lib\net40\MyCoolApp.exe.diff. Create a file that contains a SHA1 of the expected resulting file and its filesize called lib\net40\MyCoolApp.exe.shasum
  4. New DLLs in current get put in verbatim
  5. Zip it back up

The .shasum file has the same format as the Releases file described in the "'Latest' Pointer" section, except that it will only have one entry.

So now we've got all of the metadata of the original package, just none of its contents. To get the final package, we do the following:

  1. Take the previous version, expand it out
  2. Take the delta version, do the same
  3. For each DLL in the previous package, we bspatch it, then check the shasum file to ensure we created the correct resulting file
  4. If we find a DLL in the new package, just copy it over
  5. If we can't find a bspatch for a file, nuke it (it doesn't exist in the new rev)
  6. Zip it back up

Return: Table of Contents