You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

patch.html 2.8 KiB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Language" content="en-us">
  4. <title>Patch Task</title>
  5. </head>
  6. <body>
  7. <h2><a name="patch">Patch</a></h2>
  8. <h3>Description</h3>
  9. <p>Applies a diff file to originals. ; requires "patch" to be
  10. on the execution path. </p>
  11. <h3>Parameters</h3>
  12. <table border="1" cellpadding="2" cellspacing="0">
  13. <tr>
  14. <td valign="top"><b>Attribute</b></td>
  15. <td valign="top"><b>Description</b></td>
  16. <td align="center" valign="top"><b>Required</b></td>
  17. </tr>
  18. <tr>
  19. <td valign="top">patchfile</td>
  20. <td valign="top">the file that includes the diff output</td>
  21. <td align="center" valign="top">Yes</td>
  22. </tr>
  23. <tr>
  24. <td valign="top">originalfile</td>
  25. <td valign="top">the file to patch</td>
  26. <td align="center" valign="top">No, tries to guess it from the diff
  27. file</td>
  28. </tr>
  29. <tr>
  30. <td valign="top">destfile</td>
  31. <td valign="top">the file to send the output to instead of
  32. patching the file(s) in place. <em>since Ant 1.6</em></td>
  33. <td align="center" valign="top">No.</td>
  34. </tr>
  35. <tr>
  36. <td valign="top">backups</td>
  37. <td valign="top">Keep backups of the unpatched files</td>
  38. <td align="center" valign="top">No</td>
  39. </tr>
  40. <tr>
  41. <td valign="top">quiet</td>
  42. <td valign="top">Work silently unless an error occurs</td>
  43. <td align="center" valign="top">No</td>
  44. </tr>
  45. <tr>
  46. <td valign="top">reverse</td>
  47. <td valign="top">Assume patch was created with old and new files
  48. swapped.</td>
  49. <td align="center" valign="top">No</td>
  50. </tr>
  51. <tr>
  52. <td valign="top">ignorewhitespace</td>
  53. <td valign="top">Ignore whitespace differences.</td>
  54. <td align="center" valign="top">No</td>
  55. </tr>
  56. <tr>
  57. <td valign="top">strip</td>
  58. <td valign="top">Strip the smallest prefix containing <i>num</i> leading
  59. slashes from filenames.</td>
  60. <td align="center" valign="top">No</td>
  61. </tr>
  62. <tr>
  63. <td valign="top">dir</td>
  64. <td valign="top">The directory in which to run the patch command.</td>
  65. <td align="center" valign="top">No, default is the project's basedir.</td>
  66. </tr>
  67. </table>
  68. <h3>Examples</h3>
  69. <pre> &lt;patch patchfile=&quot;module.1.0-1.1.patch&quot;/&gt;</pre>
  70. <p>applies the diff included in <i>module.1.0-1.1.patch</i> to the
  71. files in base directory guessing the filename(s) from the diff output.</p>
  72. <pre> &lt;patch patchfile=&quot;module.1.0-1.1.patch&quot; strip=&quot;1&quot;/&gt;</pre>
  73. <p>like above but one leading directory part will be removed. i.e. if
  74. the diff output looked like</p>
  75. <pre>
  76. --- a/mod1.0/A Mon Jun 5 17:28:41 2000
  77. +++ a/mod1.1/A Mon Jun 5 17:28:49 2000
  78. </pre>
  79. the leading <i>a/</i> will be stripped.
  80. <hr>
  81. <p align="center">Copyright &copy; 2000-2004 The Apache Software Foundation. All rights
  82. Reserved.</p>
  83. </body>
  84. </html>