On Tue, May 19, 2009 at 10:26 AM, lightflowmark <[email protected]> wrote: > > Thanks for that. I'm embarrassed to admit I'd never used diff or written a > patch before this morning - is there some way of automatically applying > patches to the correct files? > > Currently I'm doing stuff like > diff library/Zend/Dojo/View/Helper/Dojo/Container.php > library/Zend/Dojo/View/Helper/Dojo/Container-patched.php > > library/Zend-Patches/Dojo/View/Helper/Dojo/Container-ZF-6563.patch > patch< library/Zend-Patches/Dojo/View/Helper/Dojo/Container-ZF-6563.patch
To create a patch: diff -up old.file new.file > example.patch -up makes it somewhat readable. To patch: patch -u -b < example.patch (u for the unified diff format (see diff above) and b to create a backup file.) I think your issue is also a patch issue. Try specifying -p0 (patch -p0 -u -b < example.patch). -p strips slashes. E.g. the filename inside the patch is /foo/bar/hello.php -p0 = /foo/bar/hello.php -p1 = foo/bar/hello.php -p2 = bar/hello.php -p3 = hello.php ;-) I hope I explained it all correct. Till
