- Nov 10, 2017
-
-
Alex Deymo authored
-
- Nov 08, 2017
-
-
Treehugger Robot authored
-
- Nov 07, 2017
-
-
Alex Deymo authored
The .cc and .h file had different parameter names. Updated the header to match. Bug: None Test: It builds. Change-Id: Ib6df0b04595c3cb9df3b18351ce317b1126f9809
-
- Nov 02, 2017
-
-
Alex Deymo authored
All clients now include "bsdiff/bsdiff.h" so no need for this export path anymore. Bug: None Test: `make checkbuild` Change-Id: I0cc7882a58905fcd276600ee2efa01620a7ab378
-
Tianjie Xu authored
-
- Oct 31, 2017
-
-
Tianjie Xu authored
Add a new compressor interface; and the brotli compressor which is similar to the existing bz2 one. Also add a new CompressorType argument to PatchWriter's init function; this allows us to choose the right compressor based on the input option in the future. Bug: 34220646 Test: Run bsdiff/bspatch with brotli compressor/decompressor over a list of files from angler's system image. Make succeeds. Change-Id: Id9a3db2d7d051dcb751a1fc362f4c3b9226e878b
-
- Oct 27, 2017
-
-
Alex Deymo authored
* changes: Pass the size of the new file to the PatchWriterInterface::Init() Cleanup bsdiff public API. Expose the PatchWriter generator in the public API. Correct SplitPatchWriter() comment. Add/remove includes to match used types.
-
Alex Deymo authored
Most patch formats include the size of the new file in the header. To help streaming the patch to disk while generating it, this CL passes the size of the new file to the patch writer on initialization. To do this, we also move the Init() call to the patch writer to the DiffEncoder, which makes more sense since the Close() call is also made from the DiffEnconder. Bug: None Test: Updated tests to check for this value. Change-Id: Idfaedbd492d68ab6e6cb2c1cb3883947f068c3aa
-
Alex Deymo authored
The original function used to generate a patch from two files is no longer used elsewhere so this patch removes it in favour of the newer version that takes the streams from memory buffers and uses a patch writer to generate the patch. Bug: None. Test: Ran `bsdiff` manually, verified bspatch applied correctly. Change-Id: I17aac1d3dd405d733ff6dc35abe8e683adea0d4f
-
Alex Deymo authored
We want to expose the patch writers constructors in the public API without necesarily exposing the internal details. For that, we use a factory in the public API so callers can create the PatchWriters they need. We will extend this file with new patch formats. Bug: 34220646 Test: Used this interface from the bsdiff_main.cc (see follow up CL). Change-Id: I1f005f103886579eacf37b7d9767b713e066030c
-
Alex Deymo authored
Bug: None Test: Compiles. Change-Id: I01eded0b094083eb79ccc4c59458e1b88952145d
-
Alex Deymo authored
uint64_t and similar types are defined in stdint.h, and size_t is defined in stddef.h. While these headers are included virtually everywhere anyways we should include what we use, specially in public headers. Bug: None Test: still compiles. Change-Id: I26846be960bf9c989372a05e9c4369caf02888cd
-
Alex Deymo authored
-
Tianjie Xu authored
-
- Oct 26, 2017
-
-
Tianjie Xu authored
Add a wrapper class to separate the patch read from data stream decompression. Therefore, bspatch will be able to process the patch that is compressed with various tools. Test: unittest pass Change-Id: I5214e0451bde80366e8a70b960703afb2b2a7d97
-
Alex Deymo authored
Check that we don't attempt to use the region outside the old file. While this is supported by our decoder, there's no reason why we should do that and it often means a bug in the encoder. Bug: None Test: Added unittests that would fail without the fixes. Change-Id: Ifd6d8763ae4e6b3f29a5a1289f22900a278dd1b0
-
- Oct 24, 2017
-
-
Alex Deymo authored
am: 877a6678 Change-Id: Ib9004b35cc50111898510baef48864cbd6790a6c
-
Treehugger Robot authored
-
- Oct 20, 2017
-
-
Alex Deymo authored
The suffix array is used to search for strings from the new file in the old file. The size of each element of the suffix array must be big enough to hold the length of the old file. In most of the cases we use, if not all of them, the old file is smaller than 2 GiB, which allows to use 32-bit integers for the suffix array. The previous code decided whether to use 64-bit or 32-bit integers based on the large-file surpport, even in 32-bit computers architectures which would not work in those cases; and would also use twice as much memory when constructing the suffix array of inputs smaller than 2 GiB. This patch selects the suffix array size based on the input size, effectively using half the memory in the most common case. This also improves the runtime performance due to lower cache pressure. As a side effect, this patch hides the suffix array implementation details from the public interface. This removes the limitation where the caller of libbsdiff and libbsdiff needed to be compiled with the same large-file support flags; and also hides the dependency on libdivsufsort from the public interface. While doing so, instead of re-implementing the suffix array search algorithm (which had a history of bugs and corner cases) we re-use the one from libdivsufsort, adapted to the bsdiff algorithm use-case. The result is about 40% faster when diffing 10MiB files, and the patch size is within 0.1%, due to differences in the position selected whenever more than one match is available. Bug: 34220646 Test: Added unittests for the suffix array. Change-Id: Ib9dc85a83bbf10157a3937c5687e5663ab0d20d5
-
- Oct 11, 2017
-
-
Alex Deymo authored
am: 52b6bae3 Change-Id: Ic5d3ea2844c9a0dede38492f42ea5e00366214b6
-
Treehugger Robot authored
-
Alex Deymo authored
This new PatchWriterInterface derived class allows to split the output patch of a bsdiff run into multiple files of a fixed new file size. This allows to split long operations with minimal loss of patch size due to splitting the compression blocks. For large enough new file sections, this patch size reduction should be minimal. Bug: 34220646 Test: Added unittests. Change-Id: Ib90fddd5c55a38c87ce396f2792aa558ecd07b22
-
- Oct 09, 2017
-
-
Alex Deymo authored
am: f356f501 Change-Id: I67fd6ee62c22784c228c21c8eac5d35c3e745e5e
-
Treehugger Robot authored
-
Alex Deymo authored
The recently introduced PatchWriterInterface had both the patch file format logic and the diff/extra streams selection from the control entries. While this simplifies the bsdiff main algorithm and makes invalid usages of the BsdiffPatchWriter evident, writing alternative PatchWriterInterface classes required to replicate the diff/extra stream selection logic. This patch splits out the diff/extra stream generation and all the checks around those to a new helper class DiffEncoder. The public interface PatchWriterInterface now has two methods to accept the diff and extra stream data, and does not compute them. Bug: 34220646 Test: Added unittests. Ran bsdiff on some pairs of files obtaining the same result as before. Change-Id: I5f303c06f1e10910eb00dcfda38c6811977a91cf
-
- Sep 29, 2017
-
-
Alex Deymo authored
am: bfef6ef1 Change-Id: Ifb99ffacc3939fc15af6b00772e2e7b445006b22
-
Treehugger Robot authored
* changes: Add unittest for the PatchWriter. Make BsdiffPatchWriter into an Interface. Update .gitignore to exclude tracked files.
-
- Sep 28, 2017
-
-
Alex Deymo authored
Split the unittest logic between bsdiff() function and the PatchWriter. This patch now tests individually the PatchWriter logic that writes to disk and the bsdiff() logic to create patches in the same very simple cases. We also update the Android.bp file to only pass -DBSDIFF_TARGET_UNITTEST when building for the target. Bug: 34220646 Test: ran unittests. Change-Id: I9350157ee4a0b5a617f44bb187bd7652f6d6f017
-
Alex Deymo authored
Currently, all bsdiff() functions take a filename for the patch, which is called with a temporary file in all cases. To help expose an interface that allows to write bsdiff patches in different formats (for example, changing the compressor and header format) we expose the PatchWriterInterface class in the public interface so callers can use a different one or define their own to help experimenting with bsdiff enconding improvements. Bug: 34220646 Test: make bsdiff and update_engine; ran bsdiff_unittest Change-Id: Ie450b2790137665bc033cb36d037171090b18a4b
-
Alex Deymo authored
.gitignore was ignoring all the files in the include/bsdiff/ directory because the path includes "bsdiff". This fixes it to ignore only the "bsdiff" path on the root directory. Bug: None Test: git ls-files -i --exclude-standard Change-Id: Icc85d8b4b6214786cdf13b3e886e2d7240bbccdb
-
- Sep 27, 2017
-
-
Alex Deymo authored
am: 97600586 Change-Id: I2ca100ea4498b41c3cda9e529c2342fa423dfd48
-
Alex Deymo authored
-
- Sep 26, 2017
-
-
Alex Deymo authored
Include stdint.h for uint64_t. Also remove a redundant return at the end of a function. Bug: None Test: make Change-Id: I7712bd8020bc063463f5fee09fa05439b462cfac
-
- Sep 25, 2017
-
-
Alex Deymo authored
am: cef30b31 Change-Id: I4b467e544ab95a571cec716162964a8ed5fb7208
-
Alex Deymo authored
am: b63fef9a Change-Id: Ib94cdd5cf81fbf160991833c87e711879ca04354
-
Treehugger Robot authored
-
Treehugger Robot authored
-
Alex Deymo authored
We also remove the "using std::string" clause from the files that were using it to simplify the integration with google's string type. Bug: None Test: Build and ran unittest. Change-Id: I752040494f6a6bb8447d8ff6d7cc2cf2784085d6
-
Alex Deymo authored
This prevents accidentally including a header file from another project that happens to have the same name. Test: `make checkbuild`; emerge-${BOARD} bsdiff Bug: None Change-Id: I8af132ed388738c30a8e3d7434de70b1e9d2f924
-
- Sep 20, 2017
-
-
Alex Deymo authored
am: 06c56a04 Change-Id: I4ba5b204dce9fd645697ddc8201ad1a50faf3455
-