如何手动添加拒绝补丁的更改?

时间:2014-05-10 16:07:49

标签: diff patch

我有一堆被拒绝的补丁;我想确保我正确地阅读它们。这是.rej文件:

        --- frameworks/base/telephony/java/com/android/internal/telephony/ITelephony.aidl
    +++ frameworks/base/telephony/java/com/android/internal/telephony/ITelephony.aidl
    @@ -304,5 +304,40 @@
          * Sets minimum time in milli-seconds between onCellInfoChanged
          */
         void setCellInfoListRate(int rateInMillis);
    +
    +    /**
    +     * Returns the response APDU for a command APDU sent to a logical channel
    +     */
    +    String transmitIccLogicalChannel(int cla, int command, int channel,
    +            int p1, int p2, int p3, String data);
    +
    +    /**
    +     * Returns the response APDU for a command APDU sent to the basic channel
    +     */
    +    String transmitIccBasicChannel(int cla, int command,
    +            int p1, int p2, int p3, String data);
    +
    +    /**
    +     * Returns the channel id of the logical channel,
    +     * Returns 0 on error.
    +     */
    +    int openIccLogicalChannel(String AID);
    +
    +    /**
    +     * Return true if logical channel was closed successfully
    +     */
    +    boolean closeIccLogicalChannel(int channel);
    +
    +    /**
    +     * Returns the error code of the last error occured.
    +     * Currently only used for openIccLogicalChannel
    +     */
    +    int getLastError();
    +
    +    /**
    +     * Returns the response APDU for a command APDU sent through SIM_IO
    +     */
    +    byte[] transmitIccSimIO(int fileID, int command,
    +                                      int p1, int p2, int p3, String filePath);
     }

似乎补丁实用程序也会创建原始文件。从查看原始文件,我看到只有一个方法为接口setCellInfoListRate实现,这对我理解的patch,diff以及.rej文件告诉我的内容有意义。似乎我只需要在setCellInfoListRate接口下添加带有+符号的行。你同意吗?我错过了什么吗?

1 个答案:

答案 0 :(得分:0)

关于您的问题:是的,+行是补丁添加的行。删除的行前面会有-

关于一般问题,取决于您拥有的补丁数量,并且根据您获得的错误数量,以下其中一项可能对您有用:

  1. 如果您有机会获得补丁所基于的版本(例如,从您的CVS),请将补丁应用于此版本。然后通过与当前版本进行比较并结合更改来试试运气。

  2. 如果要修补的一组明显更多的文件中只有少数文件(例如10个中的1个)制作补丁文件的副本,请删除导致错误的更改并应用其余文件。然后尝试以另一种方式应用从修补程序文件中删除的更改。这将有一些拒绝,但成为一个包含大量或大量被拒绝的补丁部分的PITA。

  3. 让补丁创建者重新定位补丁(假设是其他人)。

相关问题