免费注册 查看新帖 |

Chinaunix

广告
  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 866 | 回复: 0
打印 上一主题 下一主题

patch [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-07-28 18:10 |只看该作者 |倒序浏览
patch
patch [options]  [original [patchfile] ]
Apply the patches specified in patchfile to original. Replace the original with the new, patched version; move the original to original.orig or original~. The patch file is a difference listing produced by the diff command.
Options
-b, --backup
Back up the original file.
--backup-if-mismatch, --no-backup-if-mismatch
When not backing up all original files,
these options control whether a backup should be made when a patch does
not match the original file. The default is to make backups unless --posix is specified.
-c, --context
Interpret patchfile as a context diff.
-d dir, --directory=dir
cd to directory before beginning patch operations.
--dry-run
Print results of applying a patch, but don't change any files.
-e, --ed
Treat the contents of patchfile as ed commands.
-f, --force
Force all changes, even those that look
incorrect. Skip patches if the original file does not exist; force
patches for files with the wrong version specified; assume patches are
never reversed.
-g num, --get num
Specify whether to check the original file out of source control if it is missing or read-only. If num is a positive number, get the file. If it is negative, prompt the user. If it is 0,
do not check files out of source control. The default is negative or
the value of the PATCH_GET environment variable when set, unless the --posix option is given. In that case, the default is 0.
--help
Print help message, then exit.
-i file, --input=file
Read patch from file instead of stdin.
-l, --ignore-whitespace
Ignore whitespace while pattern matching.
-n, --normal
Interpret patch file as a normal diff.
-o file, --output=file
Print output to file.
-p[num] , --strip[=num]
Specify how much of preceding pathname to strip. A num of 0 strips everything, leaving just the filename. 1 strips the leading /. Each higher number after that strips another directory from the left.
--quoting-style=style
Set the quoting style used when printing names. The default style is shell, unless set by the environment variable QUOTING_STYLE. style may be one of the following:
c
Quote as a C language string.
escape
Like c, but without surrounding double-quote characters.
literal
Print without quoting.
shell
Quote for use in shell when needed.
shell-always
Quote for use in shell even if not needed.
--posix
Conform more strictly to the POSIX standard.
-r file, --reject-file=file
Place rejects (hunks of the patch file that patch fails to place within the original file) in file. Default is original.rej.
-s, --silent, --quiet
Suppress commentary.
-t, --batch
Skip patches if the original file does not exist.
-u, --unified
Interpret patch file as a unified context diff.
--verbose
Verbose mode.
-v, --version
Print version number and exit.
-z suffix, --suffix=suffix
Back up the original file in original.suffix.
-B prefix, --prefix=prefix
Prepend prefix to the backup filename.
-D string, --ifdef=string
Mark all changes with:
#ifdef
   string
#endif
-E, --remove-empty-files
If patch creates any empty files, delete them.
-F num, --fuzz=num
Specify the maximum number of lines that
may be ignored (fuzzed over) when deciding where to install a hunk of
code. The default is 2. Meaningful only with context diffs.
-N, --forward
Ignore patches that appear to be reversed or to have already been applied.
-R, --reverse
Do a reverse patch: attempt to undo the damage done by patching with the old and new files reversed.
-T, --set-time
When original file timestamps match the
times given in the patch header, set timestamps for patched files
according to the context diff headers. Use option -f to force date changes. Assume timestamps are in local time.
-V method, --version-control=method
Specify method for creating backup files (overridden by -B):
t, numbered
Make numbered backups.
nil, existing
Back up files according to preexisting backup schemes, with simple backups as the default. This is patch's default behavior.
never, simple
Make simple backups.
-Y prefix, --basename-prefix=prefix
Use the specified prefix with a file's basename to create backup filenames. Useful for specifying a directory.
-Z, --set-utc
When original file timestamps match the
times given in the patch header, set timestamps for patched files
according to the context diff headers. Use option -f to force date changes. Assume timestamps are in Coordinated Universal Time (UTC).
Environment variables
TMPDIR, TMP, TEMP
Specify the directory for temporary files; /tmp by default.
SIMPLE_BACKUP_SUFFIX
Suffix to append to backup files instead of .orig or ~.
QUOTING_STYLE
Specify how output should be quoted (see --quoting-style).
PATCH_GET
Specify whether patch should retrieve missing or read-only files from source control (see -g).
POSIXLY_CORRECT
When set, patch conforms more strictly to the POSIX standard (see --posix).
VERSION_CONTROL, PATCH_VERSION_CONTROL
Specify what method to use in naming backups (see -V).
               
               
               

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/22178/showart_147055.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP