Messages in this thread |  | | Date | Sun, 15 Sep 1996 21:36:29 -0700 (PDT) | From | "Erik Walthinsen (Omega)" <> | Subject | Re: patch(1)ing (was Re: Problem with 2.0.20) |
| |
On Sun, 15 Sep 1996, Adam D. Bradley wrote:
> BTW, are we both missing something here? Is there a command-line opt (or > another version) of patch that creates new files in the right places?
What I always do is just go into the directory I'm patching and use `patch -p1`. That way it doesn't care at all what the directory prefix is for either the original or patched trees. Works all the time (unless whoever made the patch used some weird method to create the patch...)
For instance, my script to extract a guaranteed clean version of the latest kernel tree from my archive of linux-2.0.tar.gz and patch-2.0.*.gz:
----------- #!/bin/sh echo -n Cleaning... rm -rf `/bin/ls -l linux | awk '{print $11}'` linux echo echo -n Extracting... tar -xzf linux-2.0.tar.gz echo cd linux echo -n Patching for n in ../patch-2.0.?.gz ../patch-2.0.??.gz;do LATEST=`echo $n | sed 's/\.\.\/patch-\(2\.0\.[0-9]*\)\.gz/\1/'` zcat $n | patch -p1 -s echo -n . done echo echo -n Wiping .orig files... find . -name '*.orig' -exec rm {} \; echo cd .. echo Latest version is $LATEST mv linux linux-$LATEST ln -s linux-$LATEST linux ----------
Note that this does no error checking. This is because all the linux patches are perfect (know a guy who patched all they way from 1.3.1[0-9] to somewhere in pre-2.0 without a problem) ;-)
TTYL, Omega
__ __ Erik Walthinsen - Programmer, webmaster, 3D artist, etc. / /\ / \ / / \ | | M E G A omega@sequent.com Work: (503)578-5314 / / /\ \ _\ /_ omega@teleport.com Home: (503)281-4281 / / /\ \ \ / /_/__\ \ \ SSA: http://www.teleport.com/~omega/sequent/ (for now) /________\ \ \ \___________\/
|  |