Subject: Re: [SLE] diff / patch problems..
On Wed, Sep 29, 2004 at 05:30:55PM +0200, Anders Norrbring wrote:
I'm about to make a patch for distribution, but I can't seem to get
right with the diff / patch pair.
That came up exactly the same. First created file in the wrong place and
things the
next that should be changed couldn't be found.
Any ideas on how I can fix my problem?
Use -p option of patch:
-pnum or --strip=num Strip the smallest prefix containing num leading slashes from each file name found in the patch file. A sequence of one or more adjacent slashes is counted as a single slash. This controls how file names found in the patch file are treated, in case you keep your files in a different directory than the person who sent out the patch. For example, supposing the file name in the patch file was
/u/howard/src/blurfl/blurfl.c
setting -p0 gives the entire file name unmodified, -p1 gives
u/howard/src/blurfl/blurfl.c
without the leading slash, -p4 gives
blurfl/blurfl.c
and not specifying -p at all just gives you blurfl.c.
Regards, -Kastus
I knew I did something wrong... :) -p1 helped. Thanx Kastus. Anders.