2018-12-21 11:20:43 +01:00
|
|
|
<!DOCTYPE html>
|
2006-09-11 04:19:00 +00:00
|
|
|
<!--
|
|
|
|
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
|
|
|
|
|
2019-05-25 13:41:47 +02:00
|
|
|
https://www.apache.org/licenses/LICENSE-2.0
|
2006-09-11 04:19:00 +00:00
|
|
|
|
|
|
|
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.
|
|
|
|
-->
|
2018-12-21 11:20:43 +01:00
|
|
|
<html lang="en">
|
2001-02-13 12:32:01 +00:00
|
|
|
|
|
|
|
<head>
|
2005-04-29 18:58:16 +00:00
|
|
|
<link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
|
2002-02-03 22:00:42 +00:00
|
|
|
<title>Patch Task</title>
|
2001-02-13 12:32:01 +00:00
|
|
|
</head>
|
|
|
|
|
|
|
|
<body>
|
|
|
|
|
2018-01-22 23:52:21 +01:00
|
|
|
<h2 id="patch">Patch</h2>
|
2001-02-13 12:32:01 +00:00
|
|
|
<h3>Description</h3>
|
2018-03-10 20:17:33 +01:00
|
|
|
<p>Applies a diff file to originals. Requires <kbd>patch</kbd> to be on the execution path.</p>
|
2001-02-13 12:32:01 +00:00
|
|
|
<h3>Parameters</h3>
|
2018-02-28 07:58:59 +01:00
|
|
|
<table class="attr">
|
2001-02-13 12:32:01 +00:00
|
|
|
<tr>
|
2018-05-15 10:29:27 +02:00
|
|
|
<th scope="col">Attribute</th>
|
|
|
|
<th scope="col">Description</th>
|
|
|
|
<th scope="col">Required</th>
|
2001-02-13 12:32:01 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
2018-02-28 07:58:59 +01:00
|
|
|
<td>patchfile</td>
|
|
|
|
<td>the file that includes the diff output</td>
|
|
|
|
<td>Yes</td>
|
2001-02-13 12:32:01 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
2018-02-28 07:58:59 +01:00
|
|
|
<td>originalfile</td>
|
|
|
|
<td>the file to patch</td>
|
|
|
|
<td>No; tries to guess it from the diff file</td>
|
2001-02-13 12:32:01 +00:00
|
|
|
</tr>
|
2003-07-07 13:05:03 +00:00
|
|
|
<tr>
|
2018-02-28 07:58:59 +01:00
|
|
|
<td>destfile</td>
|
|
|
|
<td>the file to send the output to instead of patching the file(s) in place. <em>since Apache
|
|
|
|
Ant 1.6</em></td>
|
|
|
|
<td>No</td>
|
2003-07-07 13:05:03 +00:00
|
|
|
</tr>
|
2001-02-13 12:32:01 +00:00
|
|
|
<tr>
|
2018-02-28 07:58:59 +01:00
|
|
|
<td>backups</td>
|
|
|
|
<td>Keep backups of the unpatched files</td>
|
|
|
|
<td>No</td>
|
2001-02-13 12:32:01 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
2018-02-28 07:58:59 +01:00
|
|
|
<td>quiet</td>
|
|
|
|
<td>Work silently unless an error occurs</td>
|
|
|
|
<td>No</td>
|
2001-02-13 12:32:01 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
2018-02-28 07:58:59 +01:00
|
|
|
<td>reverse</td>
|
|
|
|
<td>Assume patch was created with old and new files swapped.</td>
|
|
|
|
<td>No</td>
|
2001-02-13 12:32:01 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
2018-02-28 07:58:59 +01:00
|
|
|
<td>ignorewhitespace</td>
|
|
|
|
<td>Ignore whitespace differences.</td>
|
|
|
|
<td>No</td>
|
2001-02-13 12:32:01 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
2018-02-28 07:58:59 +01:00
|
|
|
<td>strip</td>
|
|
|
|
<td>Strip the smallest prefix containing <q>num</q> leading slashes from filenames.</td>
|
|
|
|
<td>No</td>
|
2001-02-13 12:32:01 +00:00
|
|
|
</tr>
|
2002-04-26 11:39:34 +00:00
|
|
|
<tr>
|
2018-02-28 07:58:59 +01:00
|
|
|
<td>dir</td>
|
|
|
|
<td>The directory in which to run the <code>patch</code> command.</td>
|
|
|
|
<td>No; default is the project's <var>basedir</var></td>
|
2002-04-26 11:39:34 +00:00
|
|
|
</tr>
|
2008-09-16 09:01:21 +00:00
|
|
|
<tr>
|
2018-02-28 07:58:59 +01:00
|
|
|
<td>failonerror</td>
|
|
|
|
<td>Stop the build process if the command exits with a return code signaling failure. <em>since
|
|
|
|
Ant 1.8.0</em></td>
|
|
|
|
<td>No; defaults to <q>false</q></td>
|
2008-09-16 09:01:21 +00:00
|
|
|
</tr>
|
2001-02-13 12:32:01 +00:00
|
|
|
</table>
|
|
|
|
<h3>Examples</h3>
|
2018-05-15 09:51:58 +02:00
|
|
|
|
|
|
|
<p>Apply the diff included in <samp>module.1.0-1.1.patch</samp> to the files in base directory
|
2018-02-28 07:58:59 +01:00
|
|
|
guessing the filename(s) from the diff output.</p>
|
2018-05-15 09:51:58 +02:00
|
|
|
<pre><patch patchfile="module.1.0-1.1.patch"/></pre>
|
|
|
|
|
|
|
|
<p>Here, one leading directory part will be removed:</p>
|
2018-02-28 07:58:59 +01:00
|
|
|
<pre><patch patchfile="module.1.0-1.1.patch" strip="1"/></pre>
|
2018-05-15 09:51:58 +02:00
|
|
|
<p>i.e. if the diff output looked like</p>
|
2001-02-13 12:32:01 +00:00
|
|
|
<pre>
|
2018-02-28 07:58:59 +01:00
|
|
|
--- a/mod1.0/A Mon Jun 5 17:28:41 2000
|
|
|
|
+++ a/mod1.1/A Mon Jun 5 17:28:49 2000</pre>
|
2018-05-15 09:51:58 +02:00
|
|
|
<p>the leading <samp>a/</samp> will be stripped.</p>
|
2006-09-11 04:33:25 +00:00
|
|
|
|
2001-02-13 12:32:01 +00:00
|
|
|
</body>
|
|
|
|
</html>
|