39 Commits

Author SHA1 Message Date
Robert Dower
eb522b1dc9 archive repository 2025-08-07 13:27:50 -07:00
Patrick McCarty
53ce8b6d66 Remove trailing whitespace
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2022-08-30 17:56:16 +00:00
Arjan van de Ven
02b6820a3d deal with two error cases v1.0.6 2022-08-30 14:30:34 +00:00
Patrick McCarty
f563c9a475 Fix style issues detected with clang-format v14
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2022-08-30 02:53:29 +00:00
Arjan van de Ven
72a6259228 write to a unique-ish file and then rename at the end to avoid clashes v1.0.5 2022-08-29 18:20:53 -07:00
Patrick McCarty
5c2c4c76ac gitignore: ignore incomplete or extracted dist tarballs
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2021-01-03 21:56:51 +00:00
Patrick McCarty
b45ff19ee4 gitignore: ignore more editor swap files 2021-01-03 21:54:05 +00:00
Patrick McCarty
fcd3298583 mostlyclean: also remove .i and .s files
These files will be generated by `make` if CFLAGS contains `-save-temps`
or related flags.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2021-01-03 21:53:36 +00:00
Patrick McCarty
0d3d976fe4 distclean: more closely follow automake's guidelines
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>
2021-01-03 21:43:36 +00:00
Patrick McCarty
f192356812 distcheck: fix findstatic.pl runs for vpath build
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2021-01-03 21:42:50 +00:00
Patrick McCarty
f81fb5a612 build: add placeholder m4 directory to avoid aclocal warning
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2020-12-30 04:02:54 +00:00
Patrick McCarty
0322f0839c configure: incorporate one more change from autoupdate
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2020-12-30 03:56:29 +00:00
Patrick McCarty
4807cb41f5 configure: address new warning from latest autoreconf
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>
2020-12-30 03:46:48 +00:00
Patrick McCarty
dd93df7347 Ignore editor swap files
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2020-12-30 03:35:13 +00:00
Patrick McCarty
0d1a46ed6c Fix a code style issue raised by clang-format
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2020-04-10 10:53:44 -07:00
Patrick McCarty
a1c17f3e9d Add additional code comments about some magic numbers
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>
2018-10-09 21:43:32 -07:00
Patrick McCarty
9807f60b46 Rename several more variables and add code comments
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>
2018-10-09 21:30:45 -07:00
Patrick McCarty
e27563e653 Rename oldsize->old_size and newsize->new_size
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>
2018-10-09 21:30:45 -07:00
Patrick McCarty
e0e8bcda58 Release v1.0.4
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>
v1.0.4
2018-06-14 14:50:54 -07:00
Patrick McCarty
2e5b80929c Make revised search algorithm thread safe
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>
2018-06-14 14:46:52 -07:00
Patrick McCarty
6127bd6095 Release v1.0.3
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>
v1.0.3
2018-02-22 18:04:24 -08:00
Patrick McCarty
85b1c5345b Find the longest match in the suffix-sorted array
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>
2018-02-22 18:01:17 -08:00
Patrick McCarty
d039492824 Fix code style
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2017-06-12 11:33:09 -07:00
Patrick McCarty
43a817a2e5 build: add 'compliant' makefile target for fixing code style
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2017-06-12 11:32:33 -07:00
Patrick McCarty
4e868b4772 Split suffix sort code into a separate source file
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>
2017-06-12 11:24:09 -07:00
Patrick McCarty
71b9d7e78a Allow for skipping valgrind use in tests
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>
2016-12-13 10:07:22 -08:00
Patrick McCarty
b46a4e2c0f Run clang-format to fix code style
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2016-12-13 09:49:33 -08:00
Patrick McCarty
5342235446 Release version 1.0.2
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>
v1.0.2
2016-11-21 13:25:41 -08:00
Patrick McCarty
8ed6fb38aa Fix distcheck
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>
2016-11-21 13:25:41 -08:00
Patrick McCarty
f23f25a43c Enable travis-ci integration
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2016-11-21 10:50:39 -08:00
Patrick McCarty
8654e611cf Use 'readlink -f' instead of 'realpath'
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>
2016-11-21 10:48:23 -08:00
Patrick McCarty
fb5ced7c2c configure: fix libcheck minimum version
TAP support was added in libcheck version 0.9.12.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2016-10-28 17:50:36 -07:00
Patrick McCarty
150cc28bbe configure: disable libcheck test if test build is disabled
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2016-10-28 17:48:22 -07:00
Patrick McCarty
8c0a87b7c9 Convert functional test suite to TAP
Automake provides a nice test harness that can parse TAP results, so
switch to using that.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2016-02-26 15:46:30 -08:00
Patrick McCarty
253dcbbbc0 Provide configure option to disable tests
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>
2016-02-26 15:44:21 -08:00
Patrick McCarty
a11afb9d3b Cleanups for building with test coverage
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2016-02-26 15:42:59 -08:00
Patrick McCarty
33273c0f93 Release version 1.0.1
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>
v1.0.1
2016-02-26 12:59:53 -08:00
Patrick McCarty
7525374a10 Open target files write-only and loosen their permissions
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>
2016-02-26 11:21:38 -08:00
Patrick McCarty
285133f334 Initial commit
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
v1.0.0
2016-02-16 11:57:55 -08:00