Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Jul 2002 06:21:38 -0400
From:      Jud <jud@myrealbox.com>
To:        "Jon Reynolds" <jonr@destar.net>
Cc:        "Kevin Kinsey, DaleCo, S.P." <kdk@daleco.biz>, "'questions@FreeBSD. ORG'" <questions@FreeBSD.ORG>, "Brian T. Schellenberger" <bts@babbleon.org>
Subject:   Re: diff patch
Message-ID:  <5ZYUMGDE031FC3XWURMC8IWQNLRQHF.3d3e7fb2@sparky>
In-Reply-To: <200207232219.50475.bts@babbleon.org>

next in thread | previous in thread | raw e-mail | index | archive | help
7/23/2002 10:19:50 PM, "Brian T. Schellenberger" <bts@babbleon.org> 
wrote:

>On Tuesday 23 July 2002 07:30 pm, Kevin Kinsey, DaleCo, S.P. 
wrote:
>| patch diff.txt > orig.file
>
>Please don't top-post on this list.
>
>Also, that's not the right patch syntax.  It's
>
>patch < diff-file
>
>(the patch should have the source file to which it applies already 
embedded in 
>the patch)
>
>If the file name isn't embedded, then you can do it as
>
>patch orig.file diff-file
>
>but never redirect *out* of patch.

Clearest explanation I've seen of the patch command syntax was 
Giorgios Keramidas' in March 2000 (Google Groups is your friend:) -

> What is the proper way (command) to apply a diff and recompile 
source?

Depending on how the diff was taken, you can most of the time get it to
work with:

 % cd /where/to/apply
 % patch -p0 < /path/to/patch.diff

If you're not sure the diff applies cleanly, and you suspect it might
fail to apply some hunks, then you can always add --check to the patch
options, and see what *would* happen, i.e.

 % cd /where/to/apply
 % patch -po --check < /path/to/patch.diff 2>&1 | more

Jud



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5ZYUMGDE031FC3XWURMC8IWQNLRQHF.3d3e7fb2>