当前时区为 UTC + 8 小时



发表新帖 回复这个主题  [ 4 篇帖子 ] 
作者 内容
1 楼 
 文章标题 : [求助]有人知道patch文件怎样编译吗?
帖子发表于 : 2008-02-05 0:33 

注册: 2007-08-16 20:33
帖子: 3
送出感谢: 0 次
接收感谢: 0 次
最近买了个ipod video,装了rockbox系统,有不少插件都是patch文件,说是要自己编译,不知道这些文件要怎样编译阿。
看了他们的论坛的教学帖是这样说的:
Preparation

Download the patch file after following the links on http://www.rockbox.org/patches.shtml... the file should either end in .diff or .patch
This file can be opened by Wordpad - double click on the file and select Wordpad as the program
You can see what files this patch is going to edit... for example:

Index: apps/status.c
===================================================================
RCS file: /cvsroot/rockbox/apps/status.c,v
retrieving revision 1.72
diff -u -r1.72 status.c
--- apps/status.c 6 Jul 2005 22:57:54 -0000 1.72
+++ apps/status.c 1 Aug 2005 15:34:12 -0000
@@ -82,6 +82,13 @@
status_draw(false);
}
+enum playmode status_get_ffmode(void)

The above code is part of a patch file... you can see that this part of the code is going to modify the file status.c in the apps folder
A patch or diff file can contain many sections of code like this and modify many files in one go
Move the .diff or .patch file to the source folder (eg C:\Rockbox\home\guest\rockbox-daily-XXXXXXXX\)

Patching

In the cmd window, go to the directory containing the patch (use the commands mentioned earlier on in this guide)
Type the command patch --binary -p0 < patchfilename where patchfilename is the name of the patch file you downloaded (eg jpeg.diff)
The Patch program should then patch the file... if this fails then try patch --binary -p1 < patchfilename instead (increase the number each time, up to a maximum of 5)
After you have finished patching the files, simply continue with Configuring Build instructions above
Sometimes (if the patch file isn't correctly generated) having the patch file in the root of the source files does not work, so move the patch file to the location of the files to be patched and run continue the steps below from there. In addition to this, some patches may required patching files in different locations... so repeat the process at all the different locations, until all the files have been patched (Note: first try all the patching attempts below before resorting to this)
If this fails too, then it is most likely because the patch was not designed for that particular version of the file you are patching, if this is the case then you will usually see messages telling you that a HUNK has failed eg. HUNK #2 failed at line 345 or something similar. Unless you like programming there isn't much you can do about this
If you wish to remove a patch then you just need to add a -R switch eg. patch --binary -p0 -R < patchfilename. As you can see this is identical to the command used for applying the patch but with a -R before the <
但是我用patch命令提示的是command not found!有哪位大虾能指点一下吗,谢谢


页首
 用户资料  
 
2 楼 
 文章标题 :
帖子发表于 : 2008-02-05 0:50 
头像

注册: 2005-08-14 21:55
帖子: 58428
地址: 长沙
送出感谢: 4
接收感谢: 272
只是你的这系统上面没patch命令吧。安装吧。


_________________
● 鸣学


页首
 用户资料  
 
3 楼 
 文章标题 :
帖子发表于 : 2008-02-07 1:53 

注册: 2007-08-16 20:33
帖子: 3
送出感谢: 0 次
接收感谢: 0 次
请问如何安装patch命令?


页首
 用户资料  
 
4 楼 
 文章标题 :
帖子发表于 : 2008-02-07 4:04 
头像

注册: 2007-05-10 19:42
帖子: 255
地址: 南京, Deutschland, Karlsruhe
送出感谢: 0 次
接收感谢: 0 次
sudo apt-get install patch
patch的作用就是把diff文件中做的改动添加到源文件上


页首
 用户资料  
 
显示帖子 :  排序  
发表新帖 回复这个主题  [ 4 篇帖子 ] 

当前时区为 UTC + 8 小时


在线用户

正在浏览此版面的用户:没有注册用户 和 4 位游客


不能 在这个版面发表主题
不能 在这个版面回复主题
不能 在这个版面编辑帖子
不能 在这个版面删除帖子
不能 在这个版面提交附件

前往 :  
本站点为公益性站点,用于推广开源自由软件,由 DiaHosting VPSBudgetVM VPS 提供服务。
我们认为:软件应可免费取得,软件工具在各种语言环境下皆可使用,且不会有任何功能上的差异;
人们应有定制和修改软件的自由,且方式不受限制,只要他们自认为合适。

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
简体中文语系由 王笑宇 翻译