On Thu, 22 Jan 2004, Stas Bekman wrote: > Randy Kobes wrote: > > On Thu, 22 Jan 2004, Stas Bekman wrote: > > > > > >>Steve Hay wrote: > >> > >>>The attached patch fixes these errors on Win32: > >> > >>Thanks Steve. I've committed all 3 patches for: > >> > >>t/response/TestVhost/config.pm > >>t/response/TestCompat/apache.pm > >>t/response/TestAPI/server_util.pm > >> > >>As I mentioned before I can't apply your patches as is, > >>because the path is in windows-style. > >> > >>--- t\response\TestAPI\server_util.pm.orig ... > >>+++ t\response\TestAPI\server_util.pm ... > >> > >>I think if you work with cvs, instead of copying the > >>original file and running diff against it: > >> > >> cvs diff t\response\TestAPI\server_util.pm > >> > >>it'll give you the unix path in the diff. > >> > >>I can't find an option to accept windows style path in the > >>patch(1) manpage :( > > > > > > That's a good suggestion to use cvs on Windows to generate > > the diffs, but unfortunately, at least for me, > > cvs diff -u t\response\TestAPI\server_util.pm > > will give Windows-style paths in the diff file. However, > > cvs diff -u t/response/TestAPI/server_util.pm > > will work. > > I guess it does the right thing for windows users. > > what happens if you don't give the path, but just run 'cvs diff'? I suppose > it'll give you the windows path then.
Pleasantly surprisingly, if things are configured to recursively go into subdirectories, cvs diff -u will diff everything beneath the current directory using Unix-style paths. But if Steve is like me, often there's a few unrelated things being worked on that will show up in the diff, and it's a bit tricky to edit the diff file to prune things down to what's wanted. > I suppose that it's unusual for windows users to send any > diff format patches, since otherwise I'm sure patch(1) on > unix would have had an option to handle windows paths. > and/or diff on windows produce unix passes via an option. > > I suppose this one liner could do the trick: > > perl -pi -e '/^(Index:|RCS file:|--- |\+\+\+ )/ && s|\\|/|g' patch.txt > > or as a pipe: > > cvs diff | perl -pe '/^(Index:|RCS file:|--- |\+\+\+ )/ && s|\\|/|g' > patch.txt > > Hopefully my pattern won't mess any other things ;) Again, pleasantly surprisingly, this pipe/redirection does work, at least on XP. -- best regards, randy --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
