Manual Pages for UNIX Darwin command on man patch
MyWebUniversity

Manual Pages for UNIX Darwin command on man patch

PATCH(1) PATCH(1)

NAME

patch - apply a diff file to an original

SYNOPSIS

ppaattcchh [options] [originalfile [patchfile]]

but usually just

ppaattcchh -ppnum <

DESCRIPTION

ppaattcchh takes a patch file patchfile containing a difference listing pro-

duced by the ddiiffff program and applies those differences to one or more

original files, producing patched versions. Normally the patched ver-

sions are put in place of the originals. Backups can be made; see the

-bb or --bbaacckkuupp option. The names of the files to be patched are usu-

ally taken from the patch file, but if there's just one file to be

patched it can specified on the command line as originalfile.

Upon startup, patch attempts to determine the type of the diff listing,

unless overruled by a -cc (--ccoonntteexxtt), -ee (--eedd), -nn (--nnoorrmmaall), or -uu

(--uunniiffiieedd) option. Context diffs (old-style, new-style, and unified)

and normal diffs are applied by the ppaattcchh program itself, while eedd diffs are simply fed to the eedd(1) editor via a pipe. ppaattcchh tries to skip any leading garbage, apply the diff, and then skip

any trailing garbage. Thus you could feed an article or message con-

taining a diff listing to ppaattcchh, and it should work. If the entire diff is indented by a consistent amount, or if a context diff contains lines ending in CRLF or is encapsulated one or more times by prepending

"- " to lines starting with "-" as specified by Internet RFC 934, this

is taken into account. After removing indenting or encapsulation,

lines beginning with ## are ignored, as they are considered to be com-

ments. With context diffs, and to a lesser extent with normal diffs, ppaattcchh can

detect when the line numbers mentioned in the patch are incorrect, and

attempts to find the correct place to apply each hunk of the patch. As

a first guess, it takes the line number mentioned for the hunk, plus or minus any offset used in applying the previous hunk. If that is not the correct place, ppaattcchh scans both forwards and backwards for a set of lines matching the context given in the hunk. First ppaattcchh looks for a place where all lines of the context match. If no such place is found, and it's a context diff, and the maximum fuzz factor is set to 1 or more, then another scan takes place ignoring the first and last line of context. If that fails, and the maximum fuzz factor is set to 2 or more, the first two and last two lines of context are ignored, and another scan is made. (The default maximum fuzz factor is 2.) If

ppaattcchh cannot find a place to install that hunk of the patch, it puts

the hunk out to a reject file, which normally is the name of the output

file plus a ..rreejj suffix, or ## if ..rreejj would generate a file name that

is too long (if even appending the single character ## makes the file

name too long, then ## replaces the file name's last character). (The

rejected hunk comes out in ordinary context diff form regardless of the

input patch's form. If the input was a normal diff, many of the con-

texts are simply null.) The line numbers on the hunks in the reject

file may be different than in the patch file: they reflect the approxi-

mate location patch thinks the failed hunks belong in the new file

rather than the old one. As each hunk is completed, you are told if the hunk failed, and if so which line (in the new file) ppaattcchh thought the hunk should go on. If

the hunk is installed at a different line from the line number speci-

fied in the diff you are told the offset. A single large offset may indicate that a hunk was installed in the wrong place. You are also told if a fuzz factor was used to make the match, in which case you

should also be slightly suspicious. If the --vveerrbboossee option is given,

you are also told about hunks that match exactly. If no original file origfile is specified on the command line, ppaattcchh tries to figure out from the leading garbage what the name of the file to edit is, using the following rules. First, ppaattcchh takes an ordered list of candidate file names as follows: ++oo If the header is that of a context diff, ppaattcchh takes the old and new file names in the header. A name is ignored if it does not have

enough slashes to satisfy the -ppnum or --ssttrriipp==num option. The name

//ddeevv//nnuullll is also ignored. ++oo If there is an IInnddeexx:: line in the leading garbage and if either the old and new names are both absent or if ppaattcchh is conforming to POSIX, ppaattcchh takes the name in the IInnddeexx:: line. ++oo For the purpose of the following rules, the candidate file names are considered to be in the order (old, new, index), regardless of the order that they appear in the header. Then ppaattcchh selects a file name from the candidate list as follows: ++oo If some of the named files exist, ppaattcchh selects the first name if conforming to POSIX, and the best name otherwise. ++oo If ppaattcchh is not ignoring RCS, ClearCase, Perforce, and SCCS (see the

-gg num or --ggeett==num option), and no named files exist but an RCS,

ClearCase, Perforce, or SCCS master is found, ppaattcchh selects the first named file with an RCS, ClearCase, Perforce, or SCCS master. ++oo If no named files exist, no RCS, ClearCase, Perforce, or SCCS master was found, some names are given, ppaattcchh is not conforming to POSIX,

and the patch appears to create a file, ppaattcchh selects the best name

requiring the creation of the fewest directories. ++oo If no file name results from the above heuristics, you are asked for

the name of the file to patch, and ppaattcchh selects that name.

To determine the best of a nonempty list of file names, ppaattcchh first takes all the names with the fewest path name components; of those, it then takes all the names with the shortest basename; of those, it then takes all the shortest names; finally, it takes the first remaining name. Additionally, if the leading garbage contains a PPrreerreeqq:: line, ppaattcchh takes the first word from the prerequisites line (normally a version number) and checks the original file to see if that word can be found. If not, ppaattcchh asks for confirmation before proceeding. The upshot of all this is that you should be able to say, while in a news interface, something like the following:

|| ppaattcchh -dd //uussrr//ssrrcc//llooccaall//bblluurrffll

and patch a file in the bblluurrffll directory directly from the article con-

taining the patch.

If the patch file contains more than one patch, ppaattcchh tries to apply

each of them as if they came from separate patch files. This means,

among other things, that it is assumed that the name of the file to

patch must be determined for each diff listing, and that the garbage

before each diff listing contains interesting things such as file names and revision level, as mentioned previously. OOPPTTIIOONNSS

-bb or --bbaacckkuupp

Make backup files. That is, when patching a file, rename or copy

the original instead of removing it. When backing up a file that does not exist, an empty, unreadable backup file is created as a

placeholder to represent the nonexistent file. See the -VV or --vveerr-

ssiioonn-ccoonnttrrooll option for details about how backup file names are

determined.

--bbaacckkuupp-iiff-mmiissmmaattcchh

Back up a file if the patch does not match the file exactly and if

backups are not otherwise requested. This is the default unless ppaattcchh is conforming to POSIX.

--nnoo-bbaacckkuupp-iiff-mmiissmmaattcchh

Do not back up a file if the patch does not match the file exactly

and if backups are not otherwise requested. This is the default if ppaattcchh is conforming to POSIX.

-BB pref or --pprreeffiixx==pref

Prefix pref to a file name when generating its simple backup file

name. For example, with -BB //jjuunnkk// the simple backup file name for

ssrrcc//ppaattcchh//uuttiill..cc is //jjuunnkk//ssrrcc//ppaattcchh//uuttiill..cc.

--bbiinnaarryy

Read and write all files in binary mode, except for standard output

and //ddeevv//ttttyy. This option has no effect on POSIX-conforming sys-

tems. On systems like DOS where this option makes a difference, the

patch should be generated by ddiiffff -aa --bbiinnaarryy.

-cc or --ccoonntteexxtt

Interpret the patch file as a ordinary context diff.

-dd dir or --ddiirreeccttoorryy==dir

Change to the directory dir immediately, before doing anything else.

-DD define or --iiffddeeff==define

Use the ##iiffddeeff ... ##eennddiiff construct to mark changes, with define as

the differentiating symbol.

--ddrryy-rruunn

Print the results of applying the patches without actually changing

any files.

-ee or --eedd

Interpret the patch file as an eedd script.

-EE or --rreemmoovvee-eemmppttyy-ffiilleess

Remove output files that are empty after the patches have been

applied. Normally this option is unnecessary, since ppaattcchh can exam-

ine the time stamps on the header to determine whether a file should

exist after patching. However, if the input is not a context diff

or if ppaattcchh is conforming to POSIX, ppaattcchh does not remove empty

patched files unless this option is given. When ppaattcchh removes a

file, it also attempts to remove any empty ancestor directories.

-ff or --ffoorrccee

Assume that the user knows exactly what he or she is doing, and do

not ask any questions. Skip patches whose headers do not say which

file is to be patched; patch files even though they have the wrong

version for the PPrreerreeqq:: line in the patch; and assume that patches

are not reversed even if they look like they are. This option does

not suppress commentary; use -ss for that.

-FF num or --ffuuzzzz==num

Set the maximum fuzz factor. This option only applies to diffs that have context, and causes ppaattcchh to ignore up to that many lines in

looking for places to install a hunk. Note that a larger fuzz fac-

tor increases the odds of a faulty patch. The default fuzz factor

is 2, and it may not be set to more than the number of lines of con-

text in the context diff, ordinarily 3.

-gg num or --ggeett==num

This option controls ppaattcchh's actions when a file is under RCS or

SCCS control, and does not exist or is read-only and matches the

default version, or when a file is under ClearCase or Perforce con-

trol and does not exist. If num is positive, ppaattcchh gets (or checks out) the file from the revision control system; if zero, ppaattcchh ignores RCS, ClearCase, Perforce, and SCCS and does not get the file; and if negative, ppaattcchh asks the user whether to get the file. The default value of this option is given by the value of the PPAATTCCHHGGEETT environment variable if it is set; if not, the default value is zero if ppaattcchh is conforming to POSIX, negative otherwise.

--hheellpp

Print a summary of options and exit.

-ii patchfile or --iinnppuutt==patchfile

Read the patch from patchfile. If patchfile is -, read from stan-

dard input, the default.

-ll or --iiggnnoorree-wwhhiitteessppaaccee

Match patterns loosely, in case tabs or spaces have been munged in

your files. Any sequence of one or more blanks in the patch file

matches any sequence in the original file, and sequences of blanks at the ends of lines are ignored. Normal characters must still match exactly. Each line of the context must still match a line in the original file.

-nn or --nnoorrmmaall

Interpret the patch file as a normal diff.

-NN or --ffoorrwwaarrdd

Ignore patches that seem to be reversed or already applied. See

also -RR.

-oo outfile or --oouuttppuutt==outfile

Send output to outfile instead of patching files in place. Do not

use this option if outfile is one of the files to be patched.

-ppnum or --ssttrriipp==num

Strip the smallest prefix containing num leading slashes from each

file name found in the patch file. A sequence of one or more adja-

cent slashes is counted as a single slash. This controls how file

names found in the patch file are treated, in case you keep your

files in a different directory than the person who sent out the

patch. For example, supposing the file name in the patch file was

//uu//hhoowwaarrdd//ssrrcc//bblluurrffll//bblluurrffll..cc

setting -pp00 gives the entire file name unmodified, -pp11 gives

uu//hhoowwaarrdd//ssrrcc//bblluurrffll//bblluurrffll..cc

without the leading slash, -pp44 gives

bblluurrffll//bblluurrffll..cc

and not specifying -pp at all just gives you bblluurrffll..cc. Whatever you

end up with is looked for either in the current directory, or the

directory specified by the -dd option.

--ppoossiixx

Conform more strictly to the POSIX standard, as follows. ++oo Take the first existing file from the list (old, new, index) when intuiting file names from diff headers.

++oo Do not remove files that are empty after patching.

++oo Do not ask whether to get files from RCS, ClearCase, Perforce, or SCCS. ++oo Require that all options precede the files in the command line. ++oo Do not backup files when there is a mismatch.

--qquuoottiinngg-ssttyyllee==word

Use style word to quote output names. The word should be one of the following: lliitteerraall

Output names as-is.

sshheellll Quote names for the shell if they contain shell metacharac-

ters or would cause ambiguous output.

sshheellll-aallwwaayyss

Quote names for the shell, even if they would normally not require quoting. cc Quote names as for a C language string.

eessccaappee Quote as with cc except omit the surrounding double-quote

characters.

You can specify the default value of the --qquuoottiinngg-ssttyyllee option with

the environment variable QQUUOOTTIINNGGSSTTYYLLEE. If that environment vari-

able is not set, the default value is sshheellll.

-rr rejectfile or --rreejjeecctt-ffiillee==rejectfile

Put rejects into rejectfile instead of the default ..rreejj file.

-RR or --rreevveerrssee

Assume that this patch was created with the old and new files

swapped. (Yes, I'm afraid that does happen occasionally, human nature being what it is.) ppaattcchh attempts to swap each hunk around

before applying it. Rejects come out in the swapped format. The -RR

option does not work with eedd diff scripts because there is too lit-

tle information to reconstruct the reverse operation.

If the first hunk of a patch fails, ppaattcchh reverses the hunk to see

if it can be applied that way. If it can, you are asked if you want

to have the -RR option set. If it can't, the patch continues to be

applied normally. (Note: this method cannot detect a reversed patch

if it is a normal diff and if the first command is an append (i.e. it should have been a delete) since appends always succeed, due to the fact that a null context matches anywhere. Luckily, most

patches add or change lines rather than delete them, so most

reversed normal diffs begin with a delete, which fails, triggering the heuristic.)

-ss or --ssiilleenntt or --qquuiieett

Work silently, unless an error occurs.

-tt or --bbaattcchh

Suppress questions like -ff, but make some different assumptions:

skip patches whose headers do not contain file names (the same as

-ff); skip patches for which the file has the wrong version for the

PPrreerreeqq:: line in the patch; and assume that patches are reversed if

they look like they are.

-TT or --sseett-ttiimmee

Set the modification and access times of patched files from time

stamps given in context diff headers, assuming that the context diff headers use local time. This option is not recommended, because

patches using local time cannot easily be used by people in other

time zones, and because local time stamps are ambiguous when local

clocks move backwards during daylight-saving time adjustments.

Instead of using this option, generate patches with UTC and use the

-ZZ or --sseett-uuttcc option instead.

-uu or --uunniiffiieedd

Interpret the patch file as a unified context diff.

-vv or --vveerrssiioonn

Print out ppaattcchh's revision header and patch level, and exit.

-VV method or --vveerrssiioonn-ccoonnttrrooll==method

Use method to determine backup file names. The method can also be

given by the PPAATTCCHHVVEERRSSIIOONNCCOONNTTRROOLL (or, if that's not set, the VVEERR-

SSIIOONNCCOONNTTRROOLL) environment variable, which is overridden by this option. The method does not affect whether backup files are made; it affects only the names of any backup files that are made.

The value of method is like the GNU Emacs `version-control' vari-

able; ppaattcchh also recognizes synonyms that are more descriptive. The valid values for method are (unique abbreviations are accepted): eexxiissttiinngg or nniill Make numbered backups of files that already have them, otherwise simple backups. This is the default. nnuummbbeerreedd or tt Make numbered backups. The numbered backup file name for F is F..~~N~~ where N is the version number. ssiimmppllee or nneevveerr

Make simple backups. The -BB or --pprreeffiixx, -YY or --bbaasseennaammee-pprree-

ffiixx, and -zz or --ssuuffffiixx options specify the simple backup file

name. If none of these options are given, then a simple backup

suffix is used; it is the value of the SSIIMMPPLLEEBBAACCKKUUPPSSUUFFFFIIXX envi-

ronment variable if set, and is ..oorriigg otherwise. With numbered or simple backups, if the backup file name is too long, the backup suffix ~~ is used instead; if even appending ~~ would make the name too long, then ~~ replaces the last character of the file name.

--vveerrbboossee

Output extra information about the work being done.

-xx num or --ddeebbuugg==num

Set internal debugging flags of interest only to ppaattcchh patchers.

-YY pref or --bbaasseennaammee-pprreeffiixx==pref

Prefix pref to the basename of a file name when generating its sim-

ple backup file name. For example, with -YY ..ddeell// the simple backup

file name for ssrrcc//ppaattcchh//uuttiill..cc is ssrrcc//ppaattcchh//..ddeell//uuttiill..cc.

-zz suffix or --ssuuffffiixx==suffix

Use suffix as the simple backup suffix. For example, with -zz - the

simple backup file name for ssrrcc//ppaattcchh//uuttiill..cc is ssrrcc//ppaattcchh//uuttiill..cc-.

The backup suffix may also be specified by the SSIIMMPPLLEEBBAACCKKUUPPSSUUFFFFIIXX environment variable, which is overridden by this option.

-ZZ or --sseett-uuttcc

Set the modification and access times of patched files from time

stamps given in context diff headers, assuming that the context diff headers use Coordinated Universal Time (UTC, often known as GMT).

Also see the -TT or --sseett-ttiimmee option.

The -ZZ or --sseett-uuttcc and -TT or --sseett-ttiimmee options normally refrain

from setting a file's time if the file's original time does not

match the time given in the patch header, or if its contents do not

match the patch exactly. However, if the -ff or --ffoorrccee option is

given, the file time is set regardless. Due to the limitations of ddiiffff output format, these options cannot update the times of files whose contents have not changed. Also, if you use these options, you should remove (e.g. with mmaakkee cclleeaann) all

files that depend on the patched files, so that later invocations of

mmaakkee do not get confused by the patched files' times.

ENVIRONMENT PPAATTCCHHGGEETT

This specifies whether ppaattcchh gets missing or read-only files from

RCS, ClearCase, Perforce, or SCCS by default; see the -gg or --ggeett

option. PPOOSSIIXXLLYYCCOORRRREECCTT If set, ppaattcchh conforms more strictly to the POSIX standard by

default: see the --ppoossiixx option.

QQUUOOTTIINNGGSSTTYYLLEE

Default value of the --qquuoottiinngg-ssttyyllee option.

SSIIMMPPLLEEBBAACCKKUUPPSSUUFFFFIIXX Extension to use for simple backup file names instead of ..oorriigg. TTMMPPDDIIRR, TTMMPP, TTEEMMPP

Directory to put temporary files in; ppaattcchh uses the first environ-

ment variable in this list that is set. If none are set, the

default is system-dependent; it is normally //ttmmpp on Unix hosts.

VVEERRSSIIOONNCCOONNTTRROOLL or PPAATTCCHHVVEERRSSIIOONNCCOONNTTRROOLL

Selects version control style; see the -vv or --vveerrssiioonn-ccoonnttrrooll

option. FILES

$TMPDIR//pp**

temporary files //ddeevv//ttttyy controlling terminal; used to get answers to questions asked of the user

SEE ALSO

ddiiffff(1), eedd(1) Marshall T. Rose and Einar A. Stefferud, Proposed Standard for Message

Encapsulation, Internet RFC 934

notes/rfc934.txt> (1985-01).

NNOOTTEESS FFOORR PPAATTCCHH SSEENNDDEERRSS There are several things you should bear in mind if you are going to be

sending out patches.

Create your patch systematically. A good method is the command

ddiiffff -NNaauurr old new where old and new identify the old and new directo-

ries. The names old and new should not contain any slashes. The ddiiffff command's headers should have dates and times in Universal Time using

traditional Unix format, so that patch recipients can use the -ZZ or

--sseett-uuttcc option. Here is an example command, using Bourne shell syn-

tax:

LLCCAALLLL==CC TTZZ==UUTTCC00 ddiiffff -NNaauurr ggcccc-22..77 ggcccc-22..88

Tell your recipients how to apply the patch by telling them which

directory to ccdd to, and which ppaattcchh options to use. The option string

-NNpp11 is recommended. Test your procedure by pretending to be a recipi-

ent and applying your patch to a copy of the original files.

You can save people a lot of grief by keeping a ppaattcchhlleevveell..hh file which

is patched to increment the patch level as the first diff in the patch

file you send out. If you put a PPrreerreeqq:: line in with the patch, it

won't let them apply patches out of order without some warning.

You can create a file by sending out a diff that compares //ddeevv//nnuullll or

an empty file dated the Epoch (1970-01-01 00:00:00 UTC) to the file you

want to create. This only works if the file you want to create doesn't exist already in the target directory. Conversely, you can remove a file by sending out a context diff that compares the file to be deleted with an empty file dated the Epoch. The file will be removed unless

ppaattcchh is conforming to POSIX and the -EE or --rreemmoovvee-eemmppttyy-ffiilleess option

is not given. An easy way to generate patches that create and remove

files is to use GNU ddiiffff's -NN or --nneeww-ffiillee option.

If the recipient is supposed to use the -ppN option, do not send output

that looks like this:

ddiiffff -NNaauurr vv22..00..2299//pprroogg//RREEAADDMMEE pprroogg//RREEAADDMMEE

--- vv22..00..2299//pprroogg//RREEAADDMMEE MMoonn MMaarr 1100 1155::1133::1122 11999977

++++++ pprroogg//RREEAADDMMEE MMoonn MMaarr 1177 1144::5588::2222 11999977

because the two file names have different numbers of slashes, and dif-

ferent versions of ppaattcchh interpret the file names differently. To avoid confusion, send output that looks like this instead:

ddiiffff -NNaauurr vv22..00..2299//pprroogg//RREEAADDMMEE vv22..00..3300//pprroogg//RREEAADDMMEE

--- vv22..00..2299//pprroogg//RREEAADDMMEE MMoonn MMaarr 1100 1155::1133::1122 11999977

++++++ vv22..00..3300//pprroogg//RREEAADDMMEE MMoonn MMaarr 1177 1144::5588::2222 11999977

Avoid sending patches that compare backup file names like RREEAADDMMEE..oorriigg,

since this might confuse ppaattcchh into patching a backup file instead of

the real file. Instead, send patches that compare the same base file

names in different directories, e.g. oolldd//RREEAADDMMEE and nneeww//RREEAADDMMEE.

Take care not to send out reversed patches, since it makes people won-

der whether they already applied the patch.

Try not to have your patch modify derived files (e.g. the file ccoonnffiigg-

uurree where there is a line ccoonnffiigguurree:: ccoonnffiigguurree..iinn in your makefile),

since the recipient should be able to regenerate the derived files any-

way. If you must send diffs of derived files, generate the diffs using

UTC, have the recipients apply the patch with the -ZZ or --sseett-uuttcc

option, and have them remove any unpatched files that depend on patched

files (e.g. with mmaakkee cclleeaann). While you may be able to get away with putting 582 diff listings into

one file, it may be wiser to group related patches into separate files

in case something goes haywire. DIAGNOSTICS

Diagnostics generally indicate that ppaattcchh couldn't parse your patch

file.

If the --vveerrbboossee option is given, the message HHmmmm...... indicates that

there is unprocessed text in the patch file and that ppaattcchh is attempt-

ing to intuit whether there is a patch in that text and, if so, what

kind of patch it is.

ppaattcchh's exit status is 0 if all hunks are applied successfully, 1 if some hunks cannot be applied, and 2 if there is more serious trouble.

When applying a set of patches in a loop it behooves you to check this

exit status so you don't apply a later patch to a partially patched

file. CCAAVVEEAATTSS Context diffs cannot reliably represent the creation or deletion of empty files, empty directories, or special files such as symbolic links. Nor can they represent changes to file metadata like ownership, permissions, or whether one file is a hard link to another. If changes like these are also required, separate instructions (e.g. a shell

script) to accomplish them should accompany the patch.

ppaattcchh cannot tell if the line numbers are off in an eedd script, and can detect bad line numbers in a normal diff only when it finds a change or

deletion. A context diff using fuzz factor 3 may have the same prob-

lem. Until a suitable interactive interface is added, you should prob-

ably do a context diff in these cases to see if the changes made sense. Of course, compiling without errors is a pretty good indication that

the patch worked, but not always.

ppaattcchh usually produces the correct results, even when it has to do a lot of guessing. However, the results are guaranteed to be correct

only when the patch is applied to exactly the same version of the file

that the patch was generated from.

CCOOMMPPAATTIIBBIILLIITTYY IISSSSUUEESS

The POSIX standard specifies behavior that differs from ppaattcchh's tradi-

tional behavior. You should be aware of these differences if you must interoperate with ppaattcchh versions 2.1 and earlier, which do not conform to POSIX.

++oo In traditional ppaattcchh, the -pp option's operand was optional, and a

bare -pp was equivalent to -pp00.. The -pp option now requires an oper-

and, and -pp 00 is now equivalent to -pp00. For maximum compatibility,

use options like -pp00 and -pp11.

Also, traditional ppaattcchh simply counted slashes when stripping path prefixes; ppaattcchh now counts pathname components. That is, a sequence of one or more adjacent slashes now counts as a single slash. For

maximum portability, avoid sending patches containing //// in file

names.

++oo In traditional ppaattcchh, backups were enabled by default. This behav-

ior is now enabled with the -bb or --bbaacckkuupp option.

Conversely, in POSIX ppaattcchh, backups are never made, even when there is a mismatch. In GNU ppaattcchh, this behavior is enabled with the

--nnoo-bbaacckkuupp-iiff-mmiissmmaattcchh option, or by conforming to POSIX with the

--ppoossiixx option or by setting the PPOOSSIIXXLLYYCCOORRRREECCTT environment vari-

able.

The -bb suffix option of traditional ppaattcchh is equivalent to the

-bb -zz suffix options of GNU ppaattcchh.

++oo Traditional ppaattcchh used a complicated (and incompletely documented)

method to intuit the name of the file to be patched from the patch

header. This method did not conform to POSIX, and had a few

gotchas. Now ppaattcchh uses a different, equally complicated (but bet-

ter documented) method that is optionally POSIX-conforming; we hope

it has fewer gotchas. The two methods are compatible if the file

names in the context diff header and the IInnddeexx:: line are all identi-

cal after prefix-stripping. Your patch is normally compatible if

each header's file names all contain the same number of slashes.

++oo When traditional ppaattcchh asked the user a question, it sent the ques-

tion to standard error and looked for an answer from the first file in the following list that was a terminal: standard error, standard output, //ddeevv//ttttyy, and standard input. Now ppaattcchh sends questions to standard output and gets answers from //ddeevv//ttttyy. Defaults for some answers have been changed so that ppaattcchh never goes into an infinite loop when using default answers. ++oo Traditional ppaattcchh exited with a status value that counted the number of bad hunks, or with status 1 if there was real trouble. Now ppaattcchh exits with status 1 if some hunks failed, or with 2 if there was real trouble. ++oo Limit yourself to the following options when sending instructions meant to be executed by anyone running GNU ppaattcchh, traditional ppaattcchh, or a ppaattcchh that conforms to POSIX. Spaces are significant in the following list, and operands are required.

-cc

-dd dir

-DD define

-ee

-ll

-nn

-NN

-oo outfile

-ppnum

-RR

-rr rejectfile

BUGS

Please report bugs via email to <>.

ppaattcchh could be smarter about partial matches, excessively deviant off-

sets and swapped code, but that would take an extra pass.

If code has been duplicated (for instance with ##iiffddeeff OOLLDDCCOODDEE ... ##eellssee

...... ##eennddiiff), ppaattcchh is incapable of patching both versions, and, if it

works at all, will likely patch the wrong one, and tell you that it

succeeded to boot.

If you apply a patch you've already applied, ppaattcchh thinks it is a

reversed patch, and offers to un-apply the patch. This could be con-

strued as a feature. CCOOPPYYIINNGG Copyright (C) 1984, 1985, 1986, 1988 Larry Wall. Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the

entire resulting derived work is distributed under the terms of a per-

mission notice identical to this one.

Permission is granted to copy and distribute translations of this man-

ual into another language, under the above conditions for modified ver-

sions, except that this permission notice may be included in transla-

tions approved by the copyright holders instead of in the original English. AUTHORS Larry Wall wrote the original version of ppaattcchh. Paul Eggert removed ppaattcchh's arbitrary limits; added support for binary files, setting file times, and deleting files; and made it conform better to POSIX. Other contributors include Wayne Davison, who added unidiff support, and David MacKenzie, who added configuration and backup support. GNU 2003/05/08 PATCH(1)




Contact us      |      About us      |      Term of use      |       Copyright © 2000-2019 MyWebUniversity.com ™