| 997 | | |
| | 997 | |
| | 998 | <h2><a name="PatchTask"></a>PatchTask</h2> |
| | 999 | <p> |
| | 1000 | The <em>PatchTask</em> uses the <a href="http://savannah.gnu.org/projects/patch" |
| | 1001 | target="_blank">patch</a> program to apply diff file to originals. |
| | 1002 | </p> |
| | 1003 | <p> |
| | 1004 | <b>NB:</b> the patch program must be in the system path! |
| | 1005 | </p> |
| | 1006 | |
| | 1007 | <h3>Attributes</h3> |
| | 1008 | <table> |
| | 1009 | <thead> |
| | 1010 | <tr> |
| | 1011 | <th>Name</th> |
| | 1012 | <th>Type</th> |
| | 1013 | <th>Description</th> |
| | 1014 | <th>Default</th> |
| | 1015 | <th>Required</th> |
| | 1016 | </tr> |
| | 1017 | </thead> |
| | 1018 | <tbody> |
| | 1019 | <tr> |
| | 1020 | <td>patchfile</td> |
| | 1021 | <td>String</td> |
| | 1022 | <td>File that includes the diff output</td> |
| | 1023 | <td>n/a</td> |
| | 1024 | <td>Yes</td> |
| | 1025 | </tr> |
| | 1026 | <tr> |
| | 1027 | <td>originalfile</td> |
| | 1028 | <td>String</td> |
| | 1029 | <td>File to patch. If not specified Task tries to guess it from the diff file</td> |
| | 1030 | <td>none</td> |
| | 1031 | <td>No</td> |
| | 1032 | </tr> |
| | 1033 | <tr> |
| | 1034 | <td>destfile</td> |
| | 1035 | <td>String</td> |
| | 1036 | <td>File to send the output to instead of patching the file in place</td> |
| | 1037 | <td>none</td> |
| | 1038 | <td>No</td> |
| | 1039 | </tr> |
| | 1040 | <tr> |
| | 1041 | <td>backups</td> |
| | 1042 | <td>Boolean</td> |
| | 1043 | <td>Keep backups of the unpatched files</td> |
| | 1044 | <td>false</td> |
| | 1045 | <td>No</td> |
| | 1046 | </tr> |
| | 1047 | <tr> |
| | 1048 | <td>quiet</td> |
| | 1049 | <td>Boolean</td> |
| | 1050 | <td>Work silently unless an error occurs</td> |
| | 1051 | <td>false</td> |
| | 1052 | <td>No</td> |
| | 1053 | </tr> |
| | 1054 | <tr> |
| | 1055 | <td>reverse</td> |
| | 1056 | <td>Boolean</td> |
| | 1057 | <td>Assume patch was created with old and new files swapped</td> |
| | 1058 | <td>false</td> |
| | 1059 | <td>No</td> |
| | 1060 | </tr> |
| | 1061 | <tr> |
| | 1062 | <td>ignorewhitespace</td> |
| | 1063 | <td>Boolean</td> |
| | 1064 | <td>Ignore whitespace differences</td> |
| | 1065 | <td>false</td> |
| | 1066 | <td>No</td> |
| | 1067 | </tr> |
| | 1068 | <tr> |
| | 1069 | <td>strip</td> |
| | 1070 | <td>Integer</td> |
| | 1071 | <td>Strip the smallest prefix containing specified number of leading slashes from filenames</td> |
| | 1072 | <td>none</td> |
| | 1073 | <td>No</td> |
| | 1074 | </tr> |
| | 1075 | <tr> |
| | 1076 | <td>dir</td> |
| | 1077 | <td>String</td> |
| | 1078 | <td>The directory in which to run the patch command</td> |
| | 1079 | <td>none</td> |
| | 1080 | <td>No</td> |
| | 1081 | </tr> |
| | 1082 | <tr> |
| | 1083 | <td>haltonfailure</td> |
| | 1084 | <td>Boolean</td> |
| | 1085 | <td>Stop the build process if the patching process encounters an error.</td> |
| | 1086 | <td>false</td> |
| | 1087 | <td>No</td> |
| | 1088 | </tr> |
| | 1089 | </tbody> |
| | 1090 | </table> |
| | 1091 | |
| | 1092 | <h3>Example</h3> |
| | 1093 | <pre> |
| | 1094 | <patch |
| | 1095 | patchfile="/path/to/patches/file.ext.patch" |
| | 1096 | dir="/path/to/original" |
| | 1097 | /> |
| | 1098 | </pre> |
| | 1099 | |
| | 1100 | <p>Apply "file.ext.path" to original file locataed in "/path/to/original" folder.</p> |
| | 1101 | |