开发者

How to patch a directory?

I want to patch kohana with a file called request.patch, which I have in the root directory of my Kohana install. I am using cygwin in windows 7. The patch reads as follows:

820a821,823
>           // Convert dashes to underscores
>           $controller = strtr($this->controller, '-', '');
>           
822c825
<           $class = new ReflectionClass($prefix.$this->controller);
---
>           $class = new ReflectionClass($prefix.$controller);
831a835,837
>           
>           // Convert action dashe开发者_Go百科s to underscores
>           $action = strtr($action, '-', '');

However when I cd to the kohana root and then try and apply this patch:

/cygdrive/c/cygwin/bin/patch.exe -p0 < request.patch

I receive the following error:

can't find file to patch at input line 1
Perhaps you used the wrong -p or --strip option?
File to patch:

I mean I'd even just do this manually if I knew what files the numbers were refering to?


Honestly, I'm not sure that's a proper patch file. It doesn't have the filenames or anything (hence the error). Might better to grab the patch from github. You can append .patch on the end of a commit to get a proper patch file.

The numbers would be the line numbers in the file.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜