如何修补目录?
我想使用一个名为 request.patch 的文件来修补 kohana,该文件位于 Kohana 安装的根目录中。我在 Windows 7 中使用 cygwin。补丁内容如下:
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 dashes to underscores
> $action = strtr($action, '-', '');
但是,当我 cd 到 kohana 根目录,然后尝试应用此补丁时:
/cygdrive/c/cygwin/bin/patch.exe -p0 < request.patch
我收到以下错误:
can't find file to patch at input line 1
Perhaps you used the wrong -p or --strip option?
File to patch:
我的意思是,如果我知道什么,我什至会手动执行此操作数字所指的文件?
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 dashes 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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
老实说,我不确定这是一个正确的补丁文件。它没有文件名或任何东西(因此出现错误)。最好从 github 获取补丁。您可以在提交末尾附加 .patch 以获得正确的补丁文件。
这些数字将是文件中的行号。
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.