Diff 如何手动添加被拒绝修补程序的更改?

Diff 如何手动添加被拒绝修补程序的更改?,diff,patch,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 @@ * Set

我有一堆被拒绝的补丁;我想确保我读的是正确的。以下是.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界面下添加旁边带+号的行。你同意吗?我错过什么了吗

关于您的问题:是的,
+
行是修补程序添加的行。删除的行前面会有一个
-

关于一般问题,根据您有多少个修补程序,以及您收到的错误数量,以下其中一项可能适用于您:

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

  • 如果要修补的文件数量明显增加,但只有少数文件(例如,10个文件中有1个)需要复制修补文件,请删除导致错误的更改,然后应用其余的更改。然后尝试以另一种方式应用从修补程序文件中删除的更改。这将适用于少数拒绝,但会成为一个包含大量拒绝补丁部分的PITA

  • 让补丁创建者重新设置补丁的位置(假设它是其他人)


  • 可能是重复的谢谢。大约有七个.rej文件。我知道每一个的长度可能是一个问题。我想我可以手动添加它们。现在我知道我读对了,我要试一试。伙计,非常感谢。你说得对,它们是别人的补丁。作者已经告诉我它可以手动应用。还有一些资源,比如,这可能也会有帮助。谢谢Jens。我在一个时间表上,我真的为此感到压力。我找到了第二个链接,非常有用。我在寻找一个像第一个链接一样写得很好的内容。谢谢,这很有帮助。真的很感激你,伙计。