如何修补目录?

发布于 2024-10-19 23:49:50 字数 865 浏览 0 评论 0原文

我想使用一个名为 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

扛起拖把扫天下 2024-10-26 23:49:50

老实说,我不确定这是一个正确的补丁文件。它没有文件名或任何东西(因此出现错误)。最好从 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文