patch.1 (246074) | patch.1 (246091) |
---|---|
1.\" $FreeBSD: head/usr.bin/patch/patch.1 246074 2013-01-29 17:03:18Z gabor $ | 1.\"- |
2.\" Copyright 1986, Larry Wall 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following condition 6.\" is met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this condition and the following disclaimer. 9.\" --- 4 unchanged lines hidden (view full) --- 14.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 15.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 16.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 17.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 18.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 19.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 20.\" SUCH DAMAGE. 21.\" | 2.\" Copyright 1986, Larry Wall 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following condition 6.\" is met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this condition and the following disclaimer. 9.\" --- 4 unchanged lines hidden (view full) --- 14.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 15.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 16.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 17.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 18.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 19.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 20.\" SUCH DAMAGE. 21.\" |
22.\" $OpenBSD: patch.1,v 1.22 2008/06/06 20:44:00 jmc Exp $ 23.\" $DragonFly: src/usr.bin/patch/patch.1,v 1.10 2008/08/18 19:15:55 joerg Exp $ 24.Dd August 18, 2008 | 22.\" $OpenBSD: patch.1,v 1.26 2010/09/03 11:09:29 jmc Exp $ 23.\" $FreeBSD: head/usr.bin/patch/patch.1 246091 2013-01-29 20:05:16Z delphij $ 24.Dd January 29, 2013 |
25.Dt PATCH 1 26.Os 27.Sh NAME 28.Nm patch 29.Nd apply a diff file to an original 30.Sh SYNOPSIS 31.Nm 32.Bk -words --- 21 unchanged lines hidden (view full) --- 54.Xr diff 1 55program and apply those differences to an original file, 56producing a patched version. 57If 58.Ar patchfile 59is omitted, or is a hyphen, the patch will be read from the standard input. 60.Pp 61.Nm | 25.Dt PATCH 1 26.Os 27.Sh NAME 28.Nm patch 29.Nd apply a diff file to an original 30.Sh SYNOPSIS 31.Nm 32.Bk -words --- 21 unchanged lines hidden (view full) --- 54.Xr diff 1 55program and apply those differences to an original file, 56producing a patched version. 57If 58.Ar patchfile 59is omitted, or is a hyphen, the patch will be read from the standard input. 60.Pp 61.Nm |
62will attempt to determine the type of the diff listing, unless over-ruled by a | 62will attempt to determine the type of the diff listing, unless overruled by a |
63.Fl c , 64.Fl e , 65.Fl n , 66or 67.Fl u 68option. 69Context diffs (old-style, new-style, and unified) and 70normal diffs are applied directly by the --- 273 unchanged lines hidden (view full) --- 344.Fl z Ar backup-ext , 345.Fl Fl suffix Ar backup-ext 346.Xc 347Causes the next argument to be interpreted as the backup extension, to be 348used in place of 349.Qq .orig . 350.It Fl Fl posix 351Enables strict | 63.Fl c , 64.Fl e , 65.Fl n , 66or 67.Fl u 68option. 69Context diffs (old-style, new-style, and unified) and 70normal diffs are applied directly by the --- 273 unchanged lines hidden (view full) --- 344.Fl z Ar backup-ext , 345.Fl Fl suffix Ar backup-ext 346.Xc 347Causes the next argument to be interpreted as the backup extension, to be 348used in place of 349.Qq .orig . 350.It Fl Fl posix 351Enables strict |
352.St -p1003.1-2004 | 352.St -p1003.1-2008 |
353conformance, specifically: 354.Bl -enum 355.It 356Backup files are not created unless the 357.Fl b 358option is specified. 359.It 360If unspecified, the file name used is the first of the old, new and --- 97 unchanged lines hidden (view full) --- 458.Nm 459will choose the file name by performing the following steps, with the first 460match used: 461.Bl -enum 462.It 463If 464.Nm 465is operating in strict | 353conformance, specifically: 354.Bl -enum 355.It 356Backup files are not created unless the 357.Fl b 358option is specified. 359.It 360If unspecified, the file name used is the first of the old, new and --- 97 unchanged lines hidden (view full) --- 458.Nm 459will choose the file name by performing the following steps, with the first 460match used: 461.Bl -enum 462.It 463If 464.Nm 465is operating in strict |
466.St -p1003.1-2004 | 466.St -p1003.1-2008 |
467mode, the first of the 468.Dq old , 469.Dq new 470and 471.Dq index 472file names that exist is used. 473Otherwise, 474.Nm --- 125 unchanged lines hidden (view full) --- 600.It Pa $TMPDIR/patch* 601.Nm 602temporary files 603.It Pa /dev/tty 604used to read input when 605.Nm 606prompts the user 607.El | 467mode, the first of the 468.Dq old , 469.Dq new 470and 471.Dq index 472file names that exist is used. 473Otherwise, 474.Nm --- 125 unchanged lines hidden (view full) --- 600.It Pa $TMPDIR/patch* 601.Nm 602temporary files 603.It Pa /dev/tty 604used to read input when 605.Nm 606prompts the user 607.El |
608.Sh DIAGNOSTICS 609Too many to list here, but generally indicative that 610.Nm 611couldn't parse your patch file. 612.Pp 613The message 614.Qq Hmm... 615indicates that there is unprocessed text in the patch file and that 616.Nm 617is attempting to intuit whether there is a patch in that text and, if so, 618what kind of patch it is. 619.Pp | 608.Sh EXIT STATUS |
620The 621.Nm 622utility exits with one of the following values: 623.Pp | 609The 610.Nm 611utility exits with one of the following values: 612.Pp |
624.Bl -tag -width Ds -compact -offset indent 625.It \&0 | 613.Bl -tag -width Ds -offset indent -compact 614.It 0 |
626Successful completion. | 615Successful completion. |
627.It \&1 | 616.It 1 |
628One or more lines were written to a reject file. | 617One or more lines were written to a reject file. |
629.It \*[Gt]\&1 | 618.It \*(Gt1 |
630An error occurred. 631.El 632.Pp 633When applying a set of patches in a loop it behooves you to check this 634exit status so you don't apply a later patch to a partially patched file. | 619An error occurred. 620.El 621.Pp 622When applying a set of patches in a loop it behooves you to check this 623exit status so you don't apply a later patch to a partially patched file. |
624.Sh DIAGNOSTICS 625Too many to list here, but generally indicative that 626.Nm 627couldn't parse your patch file. 628.Pp 629The message 630.Qq Hmm... 631indicates that there is unprocessed text in the patch file and that 632.Nm 633is attempting to intuit whether there is a patch in that text and, if so, 634what kind of patch it is. |
|
635.Sh SEE ALSO 636.Xr diff 1 637.Sh STANDARDS 638The 639.Nm 640utility is compliant with the | 635.Sh SEE ALSO 636.Xr diff 1 637.Sh STANDARDS 638The 639.Nm 640utility is compliant with the |
641.St -p1003.1-2004 | 641.St -p1003.1-2008 |
642specification 643(except as detailed above for the 644.Fl -posix 645option), 646though the presence of 647.Nm 648itself is optional. 649.Pp 650The flags | 642specification 643(except as detailed above for the 644.Fl -posix 645option), 646though the presence of 647.Nm 648itself is optional. 649.Pp 650The flags |
651.Op Fl CEfstuvBFVxz | 651.Op Fl BCEFfstVvxz |
652and 653.Op Fl -posix 654are extensions to that specification. 655.Sh AUTHORS 656.An Larry Wall 657with many other contributors. 658.Sh CAVEATS 659.Nm --- 41 unchanged lines hidden --- | 652and 653.Op Fl -posix 654are extensions to that specification. 655.Sh AUTHORS 656.An Larry Wall 657with many other contributors. 658.Sh CAVEATS 659.Nm --- 41 unchanged lines hidden --- |