
                                Patch Generator

                 (c) 1994 Martin Mares, MJSoft System Software

================================================================================


Preface
=======

   PatchGen, PatchGenL, Patcher and their documentation are Copyright (c) Martin
Mares, MJSoft System Software, Prague, Czech Republic.

   This  archive  can  be  freely  redistributed as long as all of its files are
included   in   their   original   form  without  any  additions,  deletions  or
modifications  (excluding addition of other README-style files and icons) and no
more  than a nominal fee is charged for its distribution.  All copyright notices
in  the  programs and accompanying documentation files must remain intact.  It's
especially  forbidden  to add various '.displayme' files and BBS advertisements.
This style of distribution is generally known as FREEWARE.

   The only exception to this rule is the Patcher executable which can be spread
without any restrictions in its original unmodified form in any kind of software
package (including commercial products).

   Source  text of all programs is included in the distribution.  You can freely
improve  it.   If  you  want  to  distribute your improved version, there're two
possibilities:   (1)  Send  your  improvements  to  me  (the best form is a diff
output)  and  I'll include them in the next release.  (2) Distribute them alone.
In  this  case, you must mention the name of original author, change the name of
the  product  (not  only  by  increasing  the  version),  and  obey  all  of the
distribution rules mentioned above.

   This  software  is  provided  "AS  IS"  without  warranty of any kind, either
expressed  or  implied.   The author is not responsible for any damage caused by
it.


Introduction
============

   Many people distribute new versions of software. This task can be done in two
significantly different ways:

   (1) Redistributing all files.  This method is simple, the user has no need to
have  the  older  version  to install the new one.  But the archives are usually
lengthy and consume much disk space.

   (2)  Distribution of patches.  When this method is used, only the differences
between  the  previous  version and the recent one are distributed.  The updates
require  much  less disk space, but the user needs to have the previous version.
This  turns  out  to  be  an  advantage  when distributing updates of commercial
software,  because  the  new version is available only to legal users which have
the old one.  Also third-party patches to commercial software can be spread this
way legally.

   If  you want to use the second method of distribution, you need some software
to generate and apply the patches.  There are already some patch generators (for
example lpatch), but they're usually very slow, their size is not so small as it
could  be  if  they  were  written  better and the products itself are big.  The
solution is ...  PatchGen!

   PatchGen eliminates at least of the previously mentioned disadvantages -- its
patch  files  are  relatively short and the programs themself are very small and
run  under any version of AmigaDOS starting with 1.2 (I think it would work also
under 1.1, but I have never seen this kickstart.  If you have it, let me know!).


Requirements
============

   - Kickstart 1.2 or higher.

   - arp.library - it's required only by the patch generators. Patcher runs
without it.

   - 68000 or higher


Generating patches
==================

   There  are  two  patch  generators  in this archive:  PatchGen and PatchGenL.
Both  of  them  produce  the  same  patch  file  format, but they use a slightly
different algorithm.  For small files, use PatchGen.  For large files, PatchGenL
could produce better results and might be faster.

   Usage:

       PatchGen[L] <file1> <file2> <dest> [CHANGE]

  <file1> - the older file
  <file2> - the newer file (PatchGen will produce a patch to create <file2> from
<file1>.
   <dest> - file to write the patch table to
   CHANGE  -  in some cases, the versions are too different to get a patch table
of reasonable size, but you _want_ to make the new file dependent on the old one
(commercial  software, grr!).  In this case, specify the CHANGE option.  The new
file  will  be stored in simple way, but it will be encrypted by contents of the
older  file  which makes it impossible to create the new file without having the
old one.

   Some dots will be printed as a progress indicator.

   Warning:   Creation  of  patch  tables  requires a lot of memory -- a size of
<file1> plus two times size of <file2>.


Applying patches
================

   To apply the patches, enter:

       Patcher <file1> <file2> <patchtab>

   This  command  transforms <file1> to <file2> using given patch table produced
by  PatchGen or PatchGenL.  The <file1> is checked to be the correct source file
by comparing its checksum with the one stored in the patch file.

   Memory requirements: <file1> + <file2> + <patchfile>. (a lot of, grr!)


History
=======

   This release has exactly the same programs as the first one had, only the
source texts have been added.


Notes
=====

   This  program  is  not the best solution if searching for differences between
two text files.  In this case, it would be better to use GNU diff.

   Plans:

       - New version of Patcher eating less memory.

       - Faster searching algorithms.

   Send suggestions, bug reports and flames to <mj@k332.feld.cvut.cz>.

