質問

I have a bunch of rejected patches; I want to make sure I am reading them correctly. Here is the .rej file:

        --- 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);
     }

Seems the patch utility creates an original file also. From looking at the original file I see that there is only one method implemented for the interface setCellInfoListRate, and that makes sense with what I understand about patch, diff, and what the .rej file is telling me. Seems I just have to add the lines with + sign next to them under the setCellInfoListRate interface. Would you agree? Am I missing something?

役に立ちましたか?

解決

Regarding your question: Yes, the + lines are lines added by the patch. Removed lines would have a - in front.

Regarding the general problem, depending on how many patches you have, and depending on the amount of errors you get, one of the following could work for you:

  1. If you have any chance to get the version on which a patch is based upon (e.g. from your CVS), apply the patch to this version. Then try your luck by comparing against the current version you have and incorporate the changes.

  2. If it is only a few files out of a set of significantly more files to be patched (e.g. 1 out of 10) make a copy of the patch file, remove the changes that cause errors and apply the rest. Then try to apply the changes removed from the patch file in another way. This will work for few rejections, but becomes a PITA with large or lots of rejected patch sections.

  3. Have the patch creator rebasing the patch (assumed it is someone else).

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top