[gnu.emacs] Using 'patch' with subdirectories

mdb@silvlis.com (Mark D. Baushke) (10/09/88)

>  Date: 8 Oct 88 04:45:50 GMT
>  From: sun!tut.cis.ohio-state.edu!mailrus!eecae!cps3xx!usenet  (Usenet file owner)
>  X-Signature: Anton Rang <rang@cpswh.cps.msu.edu>
>
>  Is there some trick to using the 'patch' program so that it finds all
>  the appropriate files to patch, even if they aren't in the current
>  directory?  I've successfully used it by having it a level up from the
>  tree I'm patching, and typing in all the filenames (yuck).  I tried to
>  use it by moving the patch file into the top of the directory tree,
>  and it really got screwed up.  It doesn't understand subdirectories at
>  all (as far as I can tell).

No trick at all is necessary. Use the "-p" option to let it use the
path given in the context diff. For example,

	% mv dist-18.50 dist-18.51
	% patch -N -p < diff-18.50-18.51

would apply the updates for 18.51.

>    Is there a newer version of 'patch' which fixes this, and if so,
>  where can I get a copy?  

Which version of patch are you using?

I am using patch 2.0 [Patch level: 11]. This works well enough for GNU
Emacs updates although it might not be the latest patch level available.
(Instructions for getting a copy given below.)

>			     Or else, can anyone tell me what I'm doing
>  wrong?  Do I need to rename the tree before applying the patch (i.e.
>  dist-18.50 --> dist-18.51 before patching)?

Yes, you should rename the old directory (or copy it) first.

Patch was written by Larry Wall <lwall@jpl-devvax.jpl.nasa.gov>.

It was originally posted to comp.sources.unix in volume7 and should be
available from archive sites such as uunet.uu.net. If you don't have
FTP access, it should also be possible to get it from the
info-server@sh.cs.net. Send a mail message with the following body:

	Request: mod.sources
	Topic: help
	Topic: patch2
	Request: end

and you will be sent 3 shar files which contain the release of patch 2.0. 
(Note: I do not know if this release has any patches applied.)

The following appears in the comments of patch #11.

#	If you are missing previous patches they can be obtained from me:
#
#	Larry Wall
#	lwall@jpl-devvax.jpl.nasa.gov
#
#	If you send a mail message of the following form it will greatly speed
#	processing:
#
#	Subject: Command
#	@SH mailpatch PATH patch 2.0 LIST
#		   ^ note the c
#
#	where PATH is a return path FROM ME TO YOU in Internet notation, and
#	LIST is the number of one or more patches you need, separated by spaces,
#	commas, and/or hyphens.  Saying 35- says everything from 35 to the end.
#
#	You can also get the patches via anonymous FTP from
#	jpl-devvax.jpl.nasa.gov (128.149.8.43).

Enjoy!
------------------------------------------------------------------------------
Mark D. Baushke                 Internet:    mdb%silvlis.com@sun.com
Silvar-Lisco, Inc.              Nameservers: mdb@silvlis.com
1080 Marsh Road                 Usenet:      {pyramid,sun}!silvlis!mdb
Menlo Park, CA 94025-1053       Telephone:   +1 415 853-6411 / +1 415 969-8328