如何申请补丁 [英] How to apply a patch

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

问题描述

我有这个补丁代码,我从一篇网络文章(从Java调用Matlab)下载。
http://www.cs.virginia.edu/~ whitehouse / matlab / JavaMatlab.html



但我不知道如何在运行WindowsXp的计算机上应用它。
我要做的是从java调用Matlab脚本文件。我已经找到了必要的源代码和所有东西,但是这个东西正在坚持回来。
我们非常感谢任何帮助。谢谢。



这是补丁代码。

 索引:MatlabControl .java 
============================================ =======================
RCS文件:/cvsroot/tinyos/tinyos-1.x/tools/java/net/tinyos/matlab /MatlabControl.java,v
检索修订版1.3
diff -u -r1.3 MatlabControl.java
--- MatlabControl.java 2004年3月31日18:43:50 -0000 1.3
+++ MatlabControl.java 2004年8月16日20:36:51 -0000
@@ -214,7 +214,8 @@
matlab.evalConsoleOutput(command);
} else {
- matlab.fevalConsoleOutput(command,args,0,null);
+ // matlab.fevalConsoleOutput(command,args,0,null);
+ matlab.fevalConsoleOutput(command,args);
}
} catch(例外e){
System.out.println(e.toString());


解决方案

您需要将该补丁应用于文件 MatlabControl.java 。在Unix上,你有这个标准的补丁程序,但Windows上通常没有。



<但是看看补丁文件,它非常小,你可以轻松地手动完成更改。查看补丁文件:必须删除左列中带有 - 的行。必须添加 + 的行。



所以你必须查看 MatlabControl。 java 并删除此行:

  matlab.fevalConsoleOutput(command,args,0,null); 

并添加以下行:

  // matlab.fevalConsoleOutput(command,args,0,null); 
matlab.fevalConsoleOutput(command,args);

换句话说,这是一个非常小而简单的变化,你只需删除最后两个参数方法调用 fevalConsoleOutput()



如果你想要补丁命令(以及许多其他Unix实用程序),您可以下载并安装 Cygwin


I have this patch code which i downloaded from a web article (Calling Matlab from Java). http://www.cs.virginia.edu/~whitehouse/matlab/JavaMatlab.html

But I donot know how to apply it in my windowsXp running computer. What I'm trying to do is call Matlab script file from java. I have found the necessary source codes and every thing but this mater is holding be back. Any help is highly appreciated. Thank you.

Here's the patch code.

Index: MatlabControl.java
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/tools/java/net/tinyos/matlab/MatlabControl.java,v
retrieving revision 1.3
diff -u -r1.3 MatlabControl.java
--- MatlabControl.java 31 Mar 2004 18:43:50 -0000 1.3
+++ MatlabControl.java 16 Aug 2004 20:36:51 -0000
@@ -214,7 +214,8 @@
          matlab.evalConsoleOutput(command);
          }else{
-               matlab.fevalConsoleOutput(command, args, 0, null);
+               //     matlab.fevalConsoleOutput(command, args, 0, null);
+               matlab.fevalConsoleOutput(command, args);
          }
      } catch (Exception e) {
          System.out.println(e.toString());

解决方案

You need to apply that patch to the file MatlabControl.java. On Unix, you have the standard patch program to do that, but that ofcourse isn't normally present on Windows.

But looking at the patch file, it's very small and you could easily do the change by hand. Look at the patch file: The lines with a - in the left column must be removed. The lines with a + must be added.

So you must look in MatlabControl.java and remove this line:

matlab.fevalConsoleOutput(command, args, 0, null);

And add these lines:

//     matlab.fevalConsoleOutput(command, args, 0, null);
matlab.fevalConsoleOutput(command, args);

In other words, it's a very small and simple change, you just have to remove the last two arguments to the method call to fevalConsoleOutput().

If you want the patch command (and lots of other Unix utilities) on Windows, you could download and install Cygwin.

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

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