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

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