views:

24

answers:

1

If I have a diff that has paths like these:

--- a/b/foo/bar/baz.pl
+++ c/foo/bar/baz.pl

Is there a way to tell the patch utility that the diff roots are at different levels? i.e. -p2 for one, yet -p1 for the other. Or is there any alternative utility that will patch in such a case?

+1  A: 

Have you tried it with just the right -p for one or the other? I think patch will try both and apply to whichever file actually exists.

Walter Mundt
@Walter: Thanks. That's a good idea to try, and it makes sense.
Pistos