如何应用django补丁 [英] How to apply django patches

查看:101
本文介绍了如何应用django补丁的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想对此错误应用补丁( http://code.djangoproject.com/ticket/ 13095 ),但我从来没有做过,我不知道从哪里开始。任何人都可以指点教程?

I want to apply a patch to this bug (http://code.djangoproject.com/ticket/13095) but I have never done it before and I have no idea where to begin. Can anyone point me to a tutorial?

推荐答案

在Linux / UNIX上,您可以使用 / code>命令。

On Linux/UNIX, you can use the patch command for this.

它的工作方式如下:

cd /usr/lib.../site-packages/django/
patch --dry-run -p1 < ~/downloads/somefix.patch

补丁命令查找文件找到所需的正确文件更新。
-p1 告诉修补程序忽略补丁文件中提到的文件夹的第一级。通常这是项目名称本身。 - 干运行选项可以防止实际执行,所以可以尝试一下。

The patch command looks in the file to find the proper files it needs to update. The -p1 tells patch to ignore the first level of the folder mentioned in the patch file. Often this is the project name itself. The --dry-run option prevents actual execution, so you can experiment with it.

当一切都好,您可以删除 - 干运行选项,实际的补丁将被应用。

When everything is allright, you can remove the --dry-run option, and the actual patch will be applied.

在Windows上,几个工具(例如WinMerge / TortoiseMerge)在菜单中有一个应用补丁选项,这将允许您执行相同的操作。

On Windows, several tools (e.g. WinMerge / TortoiseMerge) have a "Apply patch" option in the menu, which will allow you to do the same thing.

这篇关于如何应用django补丁的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆