[Dev] embarrassing patch question

John F Davis dev@trilug.org
Thu, 28 Feb 2002 11:28:30 -0500


Hello

Ok.  I've been using patch and I've asked some questions about it on IRC,
but I'm still not
sure about how to use it "CORRECTLY" or in the "PRESCRIBED-METHOD".  So,
please correct me.

I want to create a patch file to give to my co-workers and instructions on
how to use it.

With that said, here is the scenario:

I have a original directory called foo.orig and a "up-to-date" directory
called foo.latest.
So, I created a patch file using this syntax:
diff -Naur foo.orig foo.latest > foo.patch

Then to apply the patch, I did:
patch -p1 foo < foo.patch
or
patch -p1 foo.orig < foo.patch
I can't remember which one I did.

I think this is right.  However, it would be great if someone would clear
up the bit
about the target directory.  Does the target directory have to called the
same as the
"patched" or "orig" directory?  Is there a way to specify or edit the patch
file so
that the end user can have their own custom directory name.  For instance,
I used foo and foo.orig, but the end user might have directory names
like foo2 or foo.nfs, etc.

JD