免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1594 | 回复: 1
打印 上一主题 下一主题

关于patch命令和diff文件的问题(在线等) [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-06-09 22:35 |只看该作者 |倒序浏览
我在cygwin下用linux环境编程,现在碰到一个问题,想要请教大家。
就是我现在又一些扩展名为diff的补丁文件,然后我上网搜了一下发现diff文件的使用命令是:
patch 待打补丁文件 diff补丁文件
但是我发现有写diff文件是一个补丁文件针对很多文件,就是说一个diff文件要给很多文件打补丁,这样的话如果用上面这个命令就会提示找不到命令,所以我想问下这个问题怎么解决,比如我给出一个diff文件的例子:
diff -Naur orig/cdc/src/win32/javavm/include/wcejpeg_md.h patched/cdc/src/win32/javavm/include/wcejpeg_md.h
--- orig/cdc/src/win32/javavm/include/wcejpeg_md.h 1970-01-01 01:00:00.000000000 +0100
+++ patched/cdc/src/win32/javavm/include/wcejpeg_md.h 2009-05-22 08:55:48.000000000 +0200
@@ -0,0 +1,41 @@
+/*
+ * @(#)wcejpeg_md.h 1.1 07/1/24
+ *
+ * Copyright  2007-2007 Davy Preuveneers. All Rights Reserved.  
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER  
+ *  
+ * This program is free software; you can redistribute it and/or  
+ * modify it under the terms of the GNU General Public License version  
+ * 2 only, as published by the Free Software Foundation.  
+ *  
+ * This program is distributed in the hope that it will be useful, but  
+ * WITHOUT ANY WARRANTY; without even the implied warranty of  
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU  
+ * General Public License version 2 for more details (a copy is  
+ * included at /legal/license.txt).  
+ *  
+ * You should have received a copy of the GNU General Public License  
+ * version 2 along with this work; if not, write to the Free Software  
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  
+ * 02110-1301 USA  
+ *
+ */
+
+/*
+ * NOTICE: Portions Copyright (c) 2007-2009 Davy Preuveneers.
+ * This file has been modified by Davy Preuveneers on 2009/01/11. The
+ * changes are licensed under the terms of the GNU General Public
+ * License version 2. This notice was added to meet the conditions of
+ * Section 3.a of the GNU General Public License version 2.
+ */
+
+#ifndef _WIN32_WCEJPEG_MD_H
+#define _WIN32_WCEJPEG_MD_H
+
+#ifdef WINCE
+
+#pragma include_alias("jmorecfg.h", "javavm/include/win32/jmorecfg.h")
+
+#endif /* WINCE */
+
+#endif /* _WIN32_WCEJPEG_MD_H */
diff -Naur orig/cdc/src/win32/javavm/include/win32/jmorecfg.h patched/cdc/src/win32/javavm/include/win32/jmorecfg.h
--- orig/cdc/src/win32/javavm/include/win32/jmorecfg.h 1970-01-01 01:00:00.000000000 +0100
+++ patched/cdc/src/win32/javavm/include/win32/jmorecfg.h 2009-05-22 08:55:48.000000000 +0200
@@ -0,0 +1,55 @@
+/*
+ * @(#)jmorecfg.h 1.1 07/1/24
+ *
+ * Copyright  2007-2007 Davy Preuveneers. All Rights Reserved.  
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER  
+ *  
+ * This program is free software; you can redistribute it and/or  
+ * modify it under the terms of the GNU General Public License version  
+ * 2 only, as published by the Free Software Foundation.  
+ *  
+ * This program is distributed in the hope that it will be useful, but  
+ * WITHOUT ANY WARRANTY; without even the implied warranty of  
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU  
+ * General Public License version 2 for more details (a copy is  
+ * included at /legal/license.txt).  
+ *  
+ * You should have received a copy of the GNU General Public License  
+ * version 2 along with this work; if not, write to the Free Software  
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  
+ * 02110-1301 USA  
+ *
+ */
+
+/*
+ * NOTICE: Portions Copyright (c) 2007-2009 Davy Preuveneers.
+ * This file has been modified by Davy Preuveneers on 2009/01/11. The
+ * changes are licensed under the terms of the GNU General Public
+ * License version 2. This notice was added to meet the conditions of
+ * Section 3.a of the GNU General Public License version 2.
+ */
+
+#ifndef _WIN32_JMORECFG_H
+#define _WIN32_JMORECFG_H
+
+#ifdef WINCE
+
+/*
+ * For WinCE devices, "boolean" is already declared as "unsigned char" in
+ * rpcndr.h. Therefore, the redefinition of "boolean" must remain the same.
+ */
+
+#ifndef HAVE_BOOLEAN
+
+typedef unsigned char boolean;
+
+#define HAVE_BOOLEAN
+
+#pragma include_alias ("jmorecfg.h", "../share/basis/native/image/jpeg/lib/jmorecfg.h")
+#include "jmorecfg.h"
+
+#endif
+
+#endif /* WINCE */
+
+#endif /* _WIN32_JMORECFG_H */
这个文件就分别给cdc/src/win32/javavm/include/wcejpeg_md.h 和cdc/src/win32/javavm/include/win32/jmorecfg.h文件打补丁,但是如果我写命令
patch cdc/src/win32/javavm/include/wcejpeg_md.h XX.diff
这个命令就会提示我找不到待打包文件
请问我的命令应该怎么写

论坛徽章:
5
2015年辞旧岁徽章
日期:2015-03-03 16:54:152015年迎新春徽章
日期:2015-03-04 09:50:282015年亚洲杯之朝鲜
日期:2015-03-13 22:47:33IT运维版块每日发帖之星
日期:2016-01-09 06:20:00IT运维版块每周发帖之星
日期:2016-03-07 16:27:44
2 [报告]
发表于 2009-06-10 10:23 |只看该作者

回复 #1 jokerchan 的帖子

是不是cdc/src/win32/javavm/include/wcejpeg_md.h路径不对?
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP