[comp.emacs] Stupid

weltyc@nisc.nyser.net.UUCP (10/22/87)

	This may seem like a silly question, but is there an easy way
to update my GNU emacs src by using the diff files that are provided
on prep?  My knowledge of diff is limited, but I do know that there
are a number of output forms, one is an ed script, another is with
lines of context (which is what the diffs on prep are).  I can't see,
aside from manually editing, how these diffs can be applied to my
existing sources.  Am I missing some concept, some peice of software?
It seems to me that the "ed script" form would have been better suited
to be the form for the diff files, but again maybe I'm missing
something. 
	I know about rcp, BTW, I just want to know about the diffs.

Christopher Welty  ---  Asst. Director, RPI CS Labs
weltyc@cs.rpi.edu       ...!rutgers!nysernic!weltyc

markl@bloom-beacon.MIT.EDU (10/23/87)

In-Reply-To: weltyc@nisc.nyser.net's message of 22 Oct 87 19:42:44 GMT

Repository: PTT-test

Originating-Client: allspice


>	This may seem like a silly question, but is there an easy way
>to update my GNU emacs src by using the diff files that are provided
>on prep?  

Yes.  Use the "patch" program.  It takes a diff file as input and
modifies the changed files appropriately.  Syntax is something like: 

patch -pc < <diff-file>

Patch is fairly sophisticated; I believe it can apply patches generated
from diffs of varying types--context, ed script, etc.

I don't believe patch is standard UNIX equipment, but there is
probably a copy of the source on prep.

markl

Internet: markl@ptt.lcs.mit.edu

Mark L. Lambert
MIT Laboratory for Computer Science
Distributed Systems Group

----------

mb@ttidca.TTI.COM (Michael Bloom) (10/25/87)

 Christopher A. Welty writes:

>	This may seem like a silly question, but is there an easy way
>to update my GNU emacs src by using the diff files that are provided
>on prep?  

Yes! Use the "patch" program. Patch is one of the most wonderful
programs devised by man. It has been distributed through the net and
also comes on the user contributed portion of 4.3 bsd.  Grab a copy
from "/usr/src/new" on a 4.3 system. Also grab the manual page so I
can keep this followup brief.

Instructions:
	1) Pull out any new or replaced files from rms's diffs.
	2) say: "patch -p < DIFF_FILE"
	3) watch the output for any "patch failed" messages. These should
	   be rare.  If they happen, the portions of the diffs that
	   still have to be done by hand will be left in files named
	   <source_file_name>.rej

Patch understands several types of diffs, but context diffs seem to
allow patch to best recover by itself from discrepancies in the file
being patched.