MAKEPATCH

Section: User Commands (1)
Updated: 93/02/13
Index Return to Main Contents
 

NAME

makepatch - create patch diffs between two versions of source  

SYNOPSIS

makepatch [options] old new

makepatch -filelist [options] manifest  

DESCRIPTION

Makepatch generates a set of differences between two files or two sets of files maintained in two different directories and prints the results to stdout. This resulting output is suitable for use by the patch(1) program to update copies of the target file(s) from the old to the new version.

Features of this utility include:
- Recursive descend through sub-directories.
- Generation of commands to remove obsolete files.
- Automatic handling of the patchlevel.h file first.
- Automatic inclusion of Index: and Prereq: lines.
- Ability to utilize specified manifest file(s).  

ARGUMENTS

old
This is the name of either a single file or else a directory which contains copies of the older version of the target file(s); in other words, copies of the file(s) prior to any modifications.
new
This is the name of either a single file or else a directory which contains copies of the newer version of the target file(s); in other words, copies of the file(s) after the modifications have been made. A rm(1) command will automatically be generated for every old file that no longer has a corresponding new version.
 

MAKEPATCH OPTIONS

-diff cmd
If specified, cmd is the command to be used to generate the differences between the two versions of the files. If not specified, this command defaults to "diff -c".
-patchlevel pfile
If specified, pfile indicates an alternate file that is to be used in lieu of "patchlevel.h".
-man[ifest] mfile
If specified, mfile indicates the name of the manifest file which consists of a list of the files contained in both the old and the new directories.
-oldman[ifest] omfile
If specified, omfile indicates the name of the manifest file which consists of a list of the files contained in the old directory. This option is designed to be used in conjunction with the -newmanifest option. Note that the old and new directories must still be indicated.
-newman[ifest] nmfile
If specified, nmfile indicates the name of the manifest file which consists of a list of the files contained in the new directory. This option is designed to be used in conjunction with the -oldmanifest option. Note that the old and new directories must still be indicated.
 

FILELIST OPTIONS

-file[list]
This option instructs makepatch to read a manifest file, and output the list of files included in this manifest. This option is useful to turn the contents of a manifest file into a list of files suitable for other programs.
-man[ifest] mfile
If specified, mfile indicates the name of the manifest file to be used. Alternatively, the name of the manifest file may follow the command line options.
-prefix
string Every entry in the manifest file is prefixed with string before it is written to stdout.
-nosort
Retain the order of filenames from the manifest file.
 

GENERAL OPTIONS

-verbose
This is the default mode which displays information concerning makepatch's activity to stderr.
-quiet
The opposite of -verbose. This instructs makepatch to suppress the display of activity information.
-help
This causes a short help message to be displayed, after which the program immediately exits.
 

MANIFEST FILES

Although there is no formal standard for manifest files, the following rules apply:
-
If the second line from the manifest file looks like a separator line (e.g. it is empty, or contains only dashes), it is discarded and so is the first line.
-
Empty lines and lines that start with a # are ignored.
-
If there are multiple space-separated ``words'' on a line, the first word is considered to be the filename.
 

EXAMPLES

Suppose you have a directory tree emacs-18.58 containing the sources for GNU Emacs 18.58, and a directory tree emacs-18.59 containing the sources for GNU Emacs 18.59. The following command will generate the patch file needed to transform the 18.58 sources into 18.59:

makepatch emacs-18.58 emacs-18.59 > emacs-18.58-18.59.diff

This is one way to generate and use manifest files:

(cd emacs-18.58; find . -type f -print > MANIFEST)
(cd emacs-18.59; find . -type f -print > MANIFEST)
makepatch \ -oldmanifest emacs-18.58/MANIFEST \
-newmanifest emacs-18.59/MANIFEST \
emacs-18.58 emacs-18.59 > emacs-18.58-18.59.diff

The following example transforms the manifest file into a list of files suitable for GNU tar. Note the trailing / in the prefix string:

makepatch -filelist -prefix emacs-18.59/ emacs-18.59/MANIFEST | gtar -zcvf emacs-18.59.tar.Z -T -

 

SEE ALSO

diff(1), patch(1), perl(1), rm(1).  

AUTHORS

Johan Vromans (jv@mh.nl).
Jeffery Small (jeff@cjsa.uucp) donated the base version of this manual page that inspired me to complete it.


 

Index

NAME
SYNOPSIS
DESCRIPTION
ARGUMENTS
MAKEPATCH OPTIONS
FILELIST OPTIONS
GENERAL OPTIONS
MANIFEST FILES
EXAMPLES
SEE ALSO
AUTHORS

This document was created by man2html, using the manual pages.
Time: 06:59:54 GMT, December 12, 2024