Re: Proper patch syntax?


Subject: Re: Proper patch syntax?
From: Mike Tibor (tibor@lib.uaa.alaska.edu)
Date: Sat Mar 02 2002 - 17:03:30 AKST


On 2 Mar 2002, Mac Mason wrote:

>
> I've read the man pages for patch, but it didn't help.
> I want to compile 2.4.19-pre2-ac2 with the preempt patch.
> Therefore, I get the 2.4.18 tgz, the patch-2.4.18-pre2 gz, the
> 2.4.19-pre2-ac2 patch, and the preempt patch.
> The syntax I learned (reading from somewhere) is patch -p0 <
> name_of_patchfile
> So I uncompress the 2.4.18 tgz to /usr/src/linux and uncompress the rest
> of the patches in /usr/src.
> Then I run patch -p0 < patch-2.4.19-pre2
> and it runs through without errors.
> Then I run patch -p0 < patch-2.4.19-pre2-ac2 and get
>
>
> switchblade:/usr/src# patch -p0 < patch-2.4.19-pre2-ac2
> can't find file to patch at input line 4
> Perhaps you used the wrong -p or --strip option?
> The text leading up to this was:
> --------------------------
> |diff -u --new-file --recursive --exclude-from /usr/src/exclude
> linux.19p2/CREDITS linux.19pre2-ac2/CREDITS
> |--- linux.19p2/CREDITS Fri Mar 1 18:26:30 2002
> |+++ linux.19pre2-ac2/CREDITS Fri Mar 1 18:30:06 2002
> --------------------------
> File to patch:

You were close--instead of -p0, in this case you want -p1, but you also
want to be in the top level linux source directory
(/usr/src/linux-whatever):

cd /usr/src/linux-2.4.19-pre2-ac2
cat ../patch-2.4.19-pre2-ac2 | patch -p1

-p1 means 'strip the first directory off the path, in this case
"linux.19pre2-ac2".

Mike

-- 
Mike Tibor         Univ. of Alaska Anchorage    (907) 786-1001 voice
Network Technician     Consortium Library         (907) 786-6050 fax
tibor@lib.uaa.alaska.edu       http://www.lib.uaa.alaska.edu/~tibor/
http://www.lib.uaa.alaska.edu/~tibor/pgpkey  for PGP public key



This archive was generated by hypermail 2a23 : Sat Mar 02 2002 - 17:03:32 AKST