aboutsummaryrefslogtreecommitdiffstats
path: root/framework/src/ant/apache-ant-1.9.6/manual/Tasks/patch.html
blob: 96a5ee9a448ea7177182f51721a81dba8b16237d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<!--
   Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed with
   this work for additional information regarding copyright ownership.
   The ASF licenses this file to You under the Apache License, Version 2.0
   (the "License"); you may not use this file except in compliance with
   the License.  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
-->
<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
<title>Patch Task</title>
</head>

<body>

<h2><a name="patch">Patch</a></h2>
<h3>Description</h3>
<p>Applies a diff file to originals. ; requires "patch" to be
 on the execution path.  </p>
<h3>Parameters</h3>
<table border="1" cellpadding="2" cellspacing="0">
  <tr>
    <td valign="top"><b>Attribute</b></td>
    <td valign="top"><b>Description</b></td>
    <td align="center" valign="top"><b>Required</b></td>
  </tr>
  <tr>
    <td valign="top">patchfile</td> 
    <td valign="top">the file that includes the diff output</td>
    <td align="center" valign="top">Yes</td>
  </tr>
  <tr>
    <td valign="top">originalfile</td> 
    <td valign="top">the file to patch</td>
    <td align="center" valign="top">No, tries to guess it from the diff 
      file</td>
  </tr>
  <tr>
    <td valign="top">destfile</td> 
    <td valign="top">the file to send the output to instead of
      patching the file(s) in place.  <em>since Apache Ant 1.6</em></td>
    <td align="center" valign="top">No.</td>
  </tr>
  <tr>
    <td valign="top">backups</td> 
    <td valign="top">Keep backups of the unpatched files</td>
    <td align="center" valign="top">No</td>
  </tr>
  <tr>
    <td valign="top">quiet</td> 
    <td valign="top">Work silently unless an error occurs</td>
    <td align="center" valign="top">No</td>
  </tr>
  <tr>
    <td valign="top">reverse</td> 
    <td valign="top">Assume patch was created with old and new files 
      swapped.</td>
    <td align="center" valign="top">No</td>
  </tr>
  <tr>
    <td valign="top">ignorewhitespace</td> 
    <td valign="top">Ignore whitespace differences.</td>
    <td align="center" valign="top">No</td>
  </tr>
  <tr>
    <td valign="top">strip</td> 
    <td valign="top">Strip the smallest prefix containing <i>num</i> leading 
      slashes from filenames.</td>
    <td align="center" valign="top">No</td>
  </tr>
  <tr>
    <td valign="top">dir</td> 
    <td valign="top">The directory in which to run the patch command.</td>
    <td align="center" valign="top">No, default is the project's basedir.</td>
  </tr>
  <tr>
    <td valign="top">failonerror</td>
    <td valign="top">Stop the buildprocess if the command exits with a
      return code signaling failure. Defaults to false.
      <em>since Ant 1.8.0</em></td>
    <td align="center" valign="top">No</td>
  </tr>
</table>
<h3>Examples</h3>
<pre>  &lt;patch patchfile=&quot;module.1.0-1.1.patch&quot;/&gt;</pre>
<p>applies the diff included in <i>module.1.0-1.1.patch</i> to the
files in base directory guessing the filename(s) from the diff output.</p>
<pre>  &lt;patch patchfile=&quot;module.1.0-1.1.patch&quot; strip=&quot;1&quot;/&gt;</pre>
<p>like above but one leading directory part will be removed. i.e. if
the diff output looked like</p>
<pre>
--- a/mod1.0/A	Mon Jun  5 17:28:41 2000
+++ a/mod1.1/A	Mon Jun  5 17:28:49 2000
</pre> 
the leading <i>a/</i> will be stripped.


</body>
</html>