Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

       4. Apply the patch to the source file/files.

  • $ patch -p1 < index.patch

...

5. It should be applied successfully. Take In case of observing any failure when apply the patch to the source file/files then skip this step. If no failures observed then take a backup for the file/files got patched. For ex : 

  • $ cp source/Styles/xb3/code/index.php source/Styles/xb3/code/index_bk.php

        6.  In case of observing any failure when apply the patch to the source file/files, then this may expects some other patch to be applied first. In such case,

                       a. Go to the full console logs and then search for "Repo Init". 

                                 Example:

                                 Repo Init for - Project: ssh://gerrit.teamccp.com:29418/rdk/yocto_oe/manifests/cisco-intel-manifest Branch: 2003_sprint Manifest: ciscoxb3-3939B
                       b. Create another directory

                                 $ mkdir cisco_intel_repo

                                 $ cd cisco_intel_repo

                       c. Append .xml with manifest file in repo init command and Clone the repo

                                 $ repo init -u ssh://gerrit.teamccp.com:29418/rdk/yocto_oe/manifests/cisco-intel-manifest -m ciscoxb3-3939B.xml -b 2003_sprint

                                 $ repo sync -j4 --no-clone-bundle

                       d. grep with file name( in which patch applied failure observed) in meta-* layers, So that will find the other patch file which creates this file.

                                 $ grep -irn "Filename" meta-*

                       e. Apply the patch file first, and then on top of that apply the second patch file, If no failures observed then take a backup for the file/files got patched. For ex : 

                                 $ cp source/Styles/xb3/code/index.php source/Styles/xb3/code/index_bk.php

Step 4 :

  1. Now you can use "Meld tool" to compare between files to refresh the patch. Here you can compare between the source file generated in step 2 (which will have the required changes) and the source file generated in step-3 (which will have the patch appied on to it).
  2. During comparing between source files make sure that you take only the required changes (changes available in actual source file step-2) to the patched file generated in step-3.
  3. Once all changes are taken , you can verify the patch by checking the option file/format as patch in the tool. Save the updated file and copy it to your repo (repo generated in step-2).
  4. Now in your repo , you will have 2 source file (for ex: one will be index.php --original file with the required changes and index_bk.php --updated file with patch applied and also your changes).
  5. In terminal , you can use command "diff -ruN  file1 file2 > new_patch_file.patch" to generate a  new patch.
  6. For ex : diff -ruN index.php index_bk.php > new_index.patch
  7. In case patch file has more than one file, then append the difference using diff -ruN next_file nextfile_bk.php >> new_index.patch

...