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 3.1 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <!--
  2. Licensed to the Apache Software Foundation (ASF) under one or more
  3. contributor license agreements. See the NOTICE file distributed with
  4. this work for additional information regarding copyright ownership.
  5. The ASF licenses this file to You under the Apache License, Version 2.0
  6. (the "License"); you may not use this file except in compliance with
  7. the License. You may obtain a copy of the License at
  8. http://www.apache.org/licenses/LICENSE-2.0
  9. Unless required by applicable law or agreed to in writing, software
  10. distributed under the License is distributed on an "AS IS" BASIS,
  11. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. See the License for the specific language governing permissions and
  13. limitations under the License.
  14. -->
  15. <html>
  16. <head>
  17. <meta http-equiv="Content-Language" content="en-us">
  18. <link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
  19. <title>Patch Task</title>
  20. </head>
  21. <body>
  22. <h2 id="patch">Patch</h2>
  23. <h3>Description</h3>
  24. <p>Applies a diff file to originals. Requires <code>patch</code> to be on the execution path.</p>
  25. <h3>Parameters</h3>
  26. <table class="attr">
  27. <tr>
  28. <th>Attribute</th>
  29. <th>Description</th>
  30. <th>Required</th>
  31. </tr>
  32. <tr>
  33. <td>patchfile</td>
  34. <td>the file that includes the diff output</td>
  35. <td>Yes</td>
  36. </tr>
  37. <tr>
  38. <td>originalfile</td>
  39. <td>the file to patch</td>
  40. <td>No; tries to guess it from the diff file</td>
  41. </tr>
  42. <tr>
  43. <td>destfile</td>
  44. <td>the file to send the output to instead of patching the file(s) in place. <em>since Apache
  45. Ant 1.6</em></td>
  46. <td>No</td>
  47. </tr>
  48. <tr>
  49. <td>backups</td>
  50. <td>Keep backups of the unpatched files</td>
  51. <td>No</td>
  52. </tr>
  53. <tr>
  54. <td>quiet</td>
  55. <td>Work silently unless an error occurs</td>
  56. <td>No</td>
  57. </tr>
  58. <tr>
  59. <td>reverse</td>
  60. <td>Assume patch was created with old and new files swapped.</td>
  61. <td>No</td>
  62. </tr>
  63. <tr>
  64. <td>ignorewhitespace</td>
  65. <td>Ignore whitespace differences.</td>
  66. <td>No</td>
  67. </tr>
  68. <tr>
  69. <td>strip</td>
  70. <td>Strip the smallest prefix containing <q>num</q> leading slashes from filenames.</td>
  71. <td>No</td>
  72. </tr>
  73. <tr>
  74. <td>dir</td>
  75. <td>The directory in which to run the <code>patch</code> command.</td>
  76. <td>No; default is the project's <var>basedir</var></td>
  77. </tr>
  78. <tr>
  79. <td>failonerror</td>
  80. <td>Stop the build process if the command exits with a return code signaling failure. <em>since
  81. Ant 1.8.0</em></td>
  82. <td>No; defaults to <q>false</q></td>
  83. </tr>
  84. </table>
  85. <h3>Examples</h3>
  86. <pre>&lt;patch patchfile=&quot;module.1.0-1.1.patch&quot;/&gt;</pre>
  87. <p>applies the diff included in <samp>module.1.0-1.1.patch</samp> to the files in base directory
  88. guessing the filename(s) from the diff output.</p>
  89. <pre>&lt;patch patchfile=&quot;module.1.0-1.1.patch&quot; strip=&quot;1&quot;/&gt;</pre>
  90. <p>like above but one leading directory part will be removed. i.e. if the diff output looked
  91. like</p>
  92. <pre>
  93. --- a/mod1.0/A Mon Jun 5 17:28:41 2000
  94. +++ a/mod1.1/A Mon Jun 5 17:28:49 2000</pre>
  95. the leading <samp>a/</samp> will be stripped.
  96. </body>
  97. </html>