According to the documentation, `distclean` should delete files that
`configure` built. Since many of the files we have been declaring for
`distclean-local` are generated by `autoreconf`, avoid deleting several
of those files.
Also, note that the `autom4te.cache` directory is deleted by
`maintainer-clean` already. Most of the others are required for a clean
`configure` run.
To restore the tree to a pristine state, use `git clean -xffd`.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
autoreconf from autoconf 2.70 warns that AC_PROG_CC_STDC is obsolete,
recommending to use AC_PROG_CC instead. We already call the latter
macro, and the behavior change appears to have been introduced in
autoconf 2.54 (released 2002-09-13), which is older than our minimum
supported version of 2.66.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
These values originate from Colin's paper directly, but I think more
data-driven testing and analysis is needed to determine whether the
values are generally optimal.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
The goal with these variables renamings is twofold: to clarify meaning
of the values being used, and to be consistently named for ease of
readability.
For example, the "scan" variable stored the position in the new file
where a match is searched for, and "pos" stored the position in the old
file where a match is found. These variables are now named "new_pos" and
"old_pos" to reflect that they both store position information,
referencing the new and old files, respectively.
Also, declare the renamed variables closer to where they are used, since
the function is quite lengthy already, and we build the code with
-std=gnu99, so this syntax is supported.
Finally, add some (hopefully) helpful code comments to clarify the diff
creation algorithm. The bspatch code in src/patch.c is better documented
than the diff code, so I am starting with the diff code documentation.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
To align better with variable renamings in the forthcoming commit,
rename the two variables indicating size of the old and new files first.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
This release fixes an issue with libbsdiff thread safety. This was a
regression introduced in v1.0.3.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
In commit 85b1c5345b, I introduced a new "max_len" variable, used by the
search() function to store the maximum match length found in course of
the binary search.
However, I overlooked the fact that the search() function then lost
thread safety, as "max_len" would be shared by all threads of a process
using libbsdiff.
Fix the issue by not using a global variable, instead updating "max_len"
via another pointer, just like the "pos" variable is handled already.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
This release fixes a bug that results in significantly improved diff
creation times in certain cases.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
Fixes#2
The current implementation performs a binary search through the
suffix-sorted array to find byte sequence matches between old and new
files. However, the algorithm is not optimal when it repeatedly matches
very short strings, leading to performance issues as reported in issue
#2.
This commit changes the algorithm to consider *all* matches encountered
during the binary search and choose the longest of these matches.
The overall performance impact is yet to be determined, but it appears
to yield a small percentage increase in diff creation time (expected)
and a large percentage *decrease* for the case of diffing the files from
issue #2. In my testing, the creation time there decreases from approx
64 minutes to 4.5 seconds.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
To prepare for the possibility of testing other suffix sort algorithms
in the future, split this code into a separate source file for clarity.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
In case the system valgrind is not functioning properly, allow the test
suite to run without using the tool by setting SKIP_VALGRIND=1 for `make
check`.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
This release enables the functional test suite by default. To disable
the ability to run the test suite and its dependency checks, pass
--disable-tests to configure for the build.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
The remaining test files need to be distributed in order to run the test
suite, and export abs_builddir to the test script to point to the
binaries.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
Some distros do not ship the coreutils 'realpath', so use 'readlink -f'
instead, which is equivalent for the usage here.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
Building the tests is enabled by default, but because the test suite
requires root privileges to run at the moment, people should have to
option to disable the tests entirely.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
This release fixes a small issue with permissions on the target files
created by both bsdiff and bspatch, namely that there is no reason for
them not to be group and world readable.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
Because the target files are only written to, not read from, by either
bsdiff or bspatch, we can open them write-only.
Also, I don't see a reason for the file permissions to be 600, so loosen
the permissions to be 644.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>