www.delorie.com/gnu/docs/patch/patch.man.html   search  
 
Buy GNU books!


patch

NAME

SYNOPSIS

DESCRIPTION

OPTIONS

-r rejectfile or [=]=reject-file=rejectfile
Put rejects into rejectfile instead of the default .rej file.
-R or [=]=reverse
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.) patch attempts to swap each hunk around before applying it. Rejects come out in the swapped format. The -R option does not work with ed diff scripts because there is too little information to reconstruct the reverse operation.

If the first hunk of a patch fails, patch reverses the hunk to see if it can be applied that way. If it can, you are asked if you want to have the -R 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.)

-s or [=]=silent or [=]=quiet
Work silently, unless an error occurs.
-t or [=]=batch
Suppress questions like -f, but make some different assumptions: skip patches whose headers do not contain file names (the same as -f); skip patches for which the file has the wrong version for the Prereq: line in the patch; and assume that patches are reversed if they look like they are.
-T or [=]=set-time
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 -Z or [=]=set-utc option instead.
-u or [=]=unified
Interpret the patch file as a unified context diff.
-v or [=]=version
Print out patch's revision header and patch level, and exit.
-V method or [=]=version-control=method
Use method to determine backup file names. The method can also be given by the PATCH_VERSION_CONTROL (or, if that's not set, the VERSION_CONTROL) 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' variable; patch also recognizes synonyms that are more descriptive. The valid values for method are (unique abbreviations are accepted):

[=]=verbose
Output extra information about the work being done.
-x num or [=]=debug=num
Set internal debugging flags of interest only to patch patchers.
-Y pref or [=]=basename-prefix=pref
Prefix pref to the basename of a file name when generating its simple backup file name. For example, with -Y .del/ the simple backup file name for src/patch/util.c is src/patch/.del/util.c.
-z suffix or [=]=suffix=suffix
Use suffix as the simple backup suffix. For example, with -z - the simple backup file name for src/patch/util.c is src/patch/util.c-. The backup suffix may also be specified by the SIMPLE_BACKUP_SUFFIX environment variable, which is overridden by this option.
-Z or [=]=set-utc
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 -T or [=]=set-time option.

The -Z or [=]=set-utc and -T or [=]=set-time 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 -f or [=]=force option is given, the file time is set regardless.
Due to the limitations of diff 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 make clean) all files that depend on the patched files, so that later invocations of make do not get confused by the patched files' times.

ENVIRONMENT

FILES

SEE ALSO

NOTES FOR PATCH SENDERS

DIAGNOSTICS

CAVEATS

COMPATIBILITY ISSUES

BUGS

COPYING

AUTHORS


  webmaster   donations   bookstore     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003