-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create patch from .tar instead of .tar.gz (alternative solution) (#105)
* make DEFAULT_HASH_ALGORITHM part of Patcher * implement Patcher that diffs .tar content instead of .tar.gz * only verify integrity of the final patch result Verifying individual patches inside the loop does tell us which specific patch failed, but in the end we still mark all patches as .failed, so we'd be doing unnecessary work. * calculate size and hash when making diff It would be cleaner, and easier to test, if we separated the diff/patch and hash/verify steps. However, we need to verify right after patching, but *before* writing the dst file. Thus, the hash verification step was pulled inside the patch method. Now, for consistency, it makes sense to pull the hash creation into the diff method. * make the size_and_hash methods private * rewrite patcher tests to match new implementation * verify is_patch for test data * introduce MAX_SIZE_RATIO for decision patch vs full update * adapt client tests to new patcher implementation and update test data to match * undo parenthesized context (only necessary for python 3.8 support) * use tarfile instead of shutil in make_gztar_archive, for consistency (note that shutil uses tarfile under the hood anyway)
- Loading branch information
1 parent
61323f9
commit 9910d05
Showing
15 changed files
with
281 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.