| 1 |
This is the makepatch package, containing a pair of programs to assist |
| 2 |
in the generation and application of patch kits to synchronise source |
| 3 |
trees. |
| 4 |
|
| 5 |
INTRODUCTION |
| 6 |
|
| 7 |
Traditionally, source trees are updated with the 'patch' program, |
| 8 |
processing patch information that is generated by the 'diff' program. |
| 9 |
Although 'diff' and 'patch' do a very good job at patching file |
| 10 |
contents, most versions do not handle creating and deleting files and |
| 11 |
directories, and adjusting of file modes and time stamps. Newer |
| 12 |
versions of 'diff' and 'patch' seem to be able to create files, and |
| 13 |
very new versions of 'patch' can remove files. But that's about it. |
| 14 |
|
| 15 |
Another typical problem is that patch kits are typically downloaded |
| 16 |
from the Internet, or transmitted via electronic mail. It is often |
| 17 |
desirable to verify the correctness of a patch kit before even |
| 18 |
attempting to apply it. |
| 19 |
|
| 20 |
The makepatch package is designed to overcome these limitations. |
| 21 |
|
| 22 |
DESCRIPTION |
| 23 |
|
| 24 |
The makepatch package contains two programs, both written in Perl: |
| 25 |
'makepatch' and 'applypatch'. |
| 26 |
|
| 27 |
'makepatch' will generate a patch kit from two source trees. |
| 28 |
It traverses the source directory and runs a 'diff' on each pair of |
| 29 |
corresponding files, accumulating the output into a patch kit. It |
| 30 |
knows about the conventions for patch kits: if a file named |
| 31 |
patchlevel.h exists, it is handled first, so 'patch' can check the |
| 32 |
version of the source tree. Also, to deal with the non-perfect |
| 33 |
versions of 'patch' that are in use, it supplies 'Index:' and |
| 34 |
'Prereq:' lines, so 'patch' can correctly locate the files to patch, |
| 35 |
and it relocates the patch to the current directory to avoid problems |
| 36 |
with creating new files. |
| 37 |
|
| 38 |
The list of files can be specified in a so called 'manifest' file, but |
| 39 |
it can also be generated by recursively traversing the source tree. |
| 40 |
Files can be excluded using shell style wildcards and Perl regex |
| 41 |
patterns. |
| 42 |
|
| 43 |
Moreover, 'makepatch' prepends a small shell script in front of the |
| 44 |
patch kit that creates the necessary files and directories for the |
| 45 |
patch process. By running the patch kit as a shell script your source |
| 46 |
directory is prepared for the patching process. |
| 47 |
|
| 48 |
But that is not it! 'makepatch' also inserts some additional |
| 49 |
information in the patch kit for use by the 'applypatch' program. |
| 50 |
|
| 51 |
The 'applypatch' program will do the following: |
| 52 |
|
| 53 |
- It will extensively verify that the patch kit is complete and not |
| 54 |
corrupted during transfer. |
| 55 |
- It will apply some heuristics to verify that the directory in |
| 56 |
which the patch will be applied does indeed contain the expected |
| 57 |
sources. |
| 58 |
- It creates files and directories as necessary. |
| 59 |
- It applies the patch by running the 'patch' program. |
| 60 |
- Upon completion, obsolete files, directories and .orig files are |
| 61 |
removed, file modes of new files are set, and the timestamps of |
| 62 |
all patched files are adjusted. |
| 63 |
|
| 64 |
Note that 'applypatch' only requires the 'patch' program. It does not |
| 65 |
rely on a shell or shell tools. This makes it possible to apply |
| 66 |
patches on non-Unix systems. |
| 67 |
|
| 68 |
REQUIREMENTS |
| 69 |
|
| 70 |
- Perl 5.004 standard installation. |
| 71 |
- For 'makepatch': the 'diff' program. |
| 72 |
- For 'applypatch': the 'patch' program. |
| 73 |
|
| 74 |
-------------------------------------------------------------------------- |
| 75 |
Johan Vromans [email protected] |
| 76 |
Squirrel Consultancy Haarlem, the Netherlands |
| 77 |
http://www.squirrel.nl http://www.squirrel.nl/people/jvromans |
| 78 |
PGP Key 2048/4783B14D KFP=65 44 CA 66 B3 50 0B 34 CE 0E FB CA 2D 95 34 D0 |
| 79 |
---------------------- "Arms are made for hugging" ----------------------- |