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.8 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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><a name="patch">Patch</a></h2>
  23. <h3>Description</h3>
  24. <p>Applies a diff file to originals. ; requires "patch" to be
  25. on the execution path. </p>
  26. <h3>Parameters</h3>
  27. <table border="1" cellpadding="2" cellspacing="0">
  28. <tr>
  29. <td valign="top"><b>Attribute</b></td>
  30. <td valign="top"><b>Description</b></td>
  31. <td align="center" valign="top"><b>Required</b></td>
  32. </tr>
  33. <tr>
  34. <td valign="top">patchfile</td>
  35. <td valign="top">the file that includes the diff output</td>
  36. <td align="center" valign="top">Yes</td>
  37. </tr>
  38. <tr>
  39. <td valign="top">originalfile</td>
  40. <td valign="top">the file to patch</td>
  41. <td align="center" valign="top">No, tries to guess it from the diff
  42. file</td>
  43. </tr>
  44. <tr>
  45. <td valign="top">destfile</td>
  46. <td valign="top">the file to send the output to instead of
  47. patching the file(s) in place. <em>since Ant 1.6</em></td>
  48. <td align="center" valign="top">No.</td>
  49. </tr>
  50. <tr>
  51. <td valign="top">backups</td>
  52. <td valign="top">Keep backups of the unpatched files</td>
  53. <td align="center" valign="top">No</td>
  54. </tr>
  55. <tr>
  56. <td valign="top">quiet</td>
  57. <td valign="top">Work silently unless an error occurs</td>
  58. <td align="center" valign="top">No</td>
  59. </tr>
  60. <tr>
  61. <td valign="top">reverse</td>
  62. <td valign="top">Assume patch was created with old and new files
  63. swapped.</td>
  64. <td align="center" valign="top">No</td>
  65. </tr>
  66. <tr>
  67. <td valign="top">ignorewhitespace</td>
  68. <td valign="top">Ignore whitespace differences.</td>
  69. <td align="center" valign="top">No</td>
  70. </tr>
  71. <tr>
  72. <td valign="top">strip</td>
  73. <td valign="top">Strip the smallest prefix containing <i>num</i> leading
  74. slashes from filenames.</td>
  75. <td align="center" valign="top">No</td>
  76. </tr>
  77. <tr>
  78. <td valign="top">dir</td>
  79. <td valign="top">The directory in which to run the patch command.</td>
  80. <td align="center" valign="top">No, default is the project's basedir.</td>
  81. </tr>
  82. <tr>
  83. <td valign="top">failonerror</td>
  84. <td valign="top">Stop the buildprocess if the command exits with a
  85. return code signaling failure. Defaults to false.
  86. <em>since Ant 1.8.0</em></td>
  87. <td align="center" valign="top">No</td>
  88. </tr>
  89. </table>
  90. <h3>Examples</h3>
  91. <pre> &lt;patch patchfile=&quot;module.1.0-1.1.patch&quot;/&gt;</pre>
  92. <p>applies the diff included in <i>module.1.0-1.1.patch</i> to the
  93. files in base directory guessing the filename(s) from the diff output.</p>
  94. <pre> &lt;patch patchfile=&quot;module.1.0-1.1.patch&quot; strip=&quot;1&quot;/&gt;</pre>
  95. <p>like above but one leading directory part will be removed. i.e. if
  96. the diff output looked like</p>
  97. <pre>
  98. --- a/mod1.0/A Mon Jun 5 17:28:41 2000
  99. +++ a/mod1.1/A Mon Jun 5 17:28:49 2000
  100. </pre>
  101. the leading <i>a/</i> will be stripped.
  102. </body>
  103. </html>