bsdiff-portable

A more portable version of Colin Percival's bsdiff
git clone git://git.sgregoratto.me/bsdiff-portable
Log | Files | Refs | LICENSE

commit dd2d14cdd934724729372920be7f0c843238a93d
parent 9496546ec6bbc16ba0ad4db9bb002ec3c7f43609
Author: Stephen Gregoratto <dev@sgregoratto.me>
Date:   Wed, 23 Sep 2020 23:11:28 +1000

Use the FreeBSD manpages for extra info

Diffstat:
Mbsdiff.1 | 60+++++++++++++++++++++++++++++++++++++++++-------------------
Mbspatch.1 | 61++++++++++++++++++++++++++++++++++++++++++++-----------------
2 files changed, 85 insertions(+), 36 deletions(-)

diff --git a/bsdiff.1 b/bsdiff.1 @@ -23,41 +23,63 @@ .\" IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.\" $FreeBSD: src/usr.bin/bsdiff/bsdiff/bsdiff.1,v 1.1 2005/08/06 01:59:05 cperciva Exp $ +.\" $FreeBSD$ .\" .Dd May 18, 2003 .Dt BSDIFF 1 -.Os FreeBSD +.Os .Sh NAME .Nm bsdiff .Nd generate a patch between two binary files .Sh SYNOPSIS .Nm -.Ao Ar oldfile Ac Ao Ar newfile Ac Ao Ar patchfile Ac +.Ar oldfile newfile patchfile .Sh DESCRIPTION +The .Nm -compares -.Ao Ar oldfile Ac +utility compares +.Ar oldfile to -.Ao Ar newfile Ac +.Ar newfile and writes to -.Ao Ar patchfile Ac -a binary patch suitable for use by bspatch(1). +.Ar patchfile +a binary patch suitable for use by +.Xr bspatch 1 . When -.Ao Ar oldfile Ac +.Ar oldfile and -.Ao Ar newfile Ac -are two versions of an executable program, the -patches produced are on average a factor of five smaller -than those produced by any other binary patch tool known -to the author. +.Ar newfile +are two versions of an executable program, +the patches produced are on average a factor of five smaller than those +produced by any other binary patch tool known to the author. .Pp +The .Nm -uses memory equal to 17 times the size of -.Ao Ar oldfile Ac , -and requires -an absolute minimum working set size of 8 times the size of oldfile. +utility +uses memory equal to 17 times the size of +.Ar oldfile , +and requires an absolute minimum working set size of 8 times the size of +.Ar oldfile . .Sh SEE ALSO .Xr bspatch 1 .Sh AUTHORS -.An Colin Percival Aq cperciva@freebsd.org +.An Colin Percival Aq Mt cperciva@FreeBSD.org +.Sh BUGS +The +.Nm +utility does not store the hashes of +.Ar oldfile +or +.Ar newfile +in +.Ar patchfile . +As a result, it is possible to apply a patch to the wrong file; +this will usually produce garbage. +It is recommended that users of +.Nm +store the hashes of +.Ar oldfile +and +.Ar newfile +and compare against them before and after applying +.Ar patchfile . diff --git a/bspatch.1 b/bspatch.1 @@ -23,37 +23,64 @@ .\" IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.\" $FreeBSD: src/usr.bin/bsdiff/bspatch/bspatch.1,v 1.1 2005/08/06 01:59:06 cperciva Exp $ +.\" $FreeBSD$ .\" .Dd May 18, 2003 .Dt BSPATCH 1 -.Os FreeBSD +.Os .Sh NAME .Nm bspatch -.Nd apply a patch built with bsdiff(1) +.Nd apply a patch built with +.Xr bsdiff 1 .Sh SYNOPSIS .Nm -.Ao Ar oldfile Ac Ao Ar newfile Ac Ao Ar patchfile Ac +.Ar oldfile newfile patchfile .Sh DESCRIPTION +The .Nm -generates -.Ao Ar newfile Ac +utility generates +.Ar newfile from -.Ao Ar oldfile Ac +.Ar oldfile and -.Ao Ar patchfile Ac +.Ar patchfile where -.Ao Ar patchfile Ac -is a binary patch built by bsdiff(1). +.Ar patchfile +is a binary patch built by +.Xr bsdiff 1 . .Pp +The .Nm -uses memory equal to the size of -.Ao Ar oldfile Ac -plus the size of -.Ao Ar newfile Ac , -but can tolerate a very small working set without a dramatic loss -of performance. +utility uses memory equal to the size of +.Ar oldfile +plus the size of +.Ar newfile , +but can tolerate a very small working set without a dramatic loss of +performance. .Sh SEE ALSO .Xr bsdiff 1 .Sh AUTHORS -.An Colin Percival Aq cperciva@freebsd.org +.An Colin Percival Aq Mt cperciva@FreeBSD.org +.Sh BUGS +The +.Nm +utility does not verify that +.Ar oldfile +is the correct source file for +.Ar patchfile . +Attempting to apply a patch to the wrong file will usually produce +garbage; +consequently it is strongly recommended that users of +.Nm +verify that +.Ar oldfile +matches the source file from which +.Ar patchfile +was built, by comparing cryptographic hashes, for example. +Users may also wish to verify after running +.Nm +that +.Ar newfile +matches the target file from which +.Ar oldfile +was built.