【问题标题】:How do I manually add the changes of a rejected patch?如何手动添加被拒绝补丁的更改?
【发布时间】:2014-06-28 07:08:19
【问题描述】:

我有一堆被拒绝的补丁;我想确保我正确阅读它们。这是 .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 实现,这与我对补丁、差异和 .rej 文件告诉我的理解有关。似乎我只需要在 setCellInfoListRate 接口下添加带有 + 号的行。你会同意吗?我错过了什么吗?

【问题讨论】:

标签: diff patch


【解决方案1】:

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

关于一般问题,根据您拥有的补丁数量以及您遇到的错误数量,以下方法之一可能适合您:

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

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

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

【讨论】:

  • 谢谢。大约有七个 .rej 文件。我知道每个的长度可能是一个问题。我想我可以手动添加它们。我现在要试一试,因为我知道我正在正确地阅读它们。伙计,谢谢一百万。你是对的,它们是别人的补丁。作者已经告诉我它可以手动应用。
  • 这里也有一些资源,例如 herehere,它们也可能会有所帮助。
  • 谢谢詹斯。我在一个时间表上,我真的为此感到压力。我找到了第二个链接,它非常有帮助。我正在寻找一个写得很好的内容,比如第一个链接。谢谢它有很大帮助。真的很感激。
猜你喜欢
  • 1970-01-01
  • 2016-11-15
  • 1970-01-01
  • 2017-09-07
  • 2011-06-09
  • 2011-12-21
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多