[2] Technical miscellaneous --patch command patch

"Bird Brother Linux private kitchens" 368, patch command.

 

1.patch usage  

 Digital patch -p <patch_file

2.patch command examples

cd u-boot-1.1.6 / // into the original file directory      

patch -p1  <../u-boot-1.1.6_jz2440.patach   
// "p" represents the first of several to remove part of the patch file path. "1" indicates the first one is removed
// "<" refers to the patch file location
// "../" represents a return to the directory because this patch file and the original file in the same directory

Here I think the bird brother said that good than online, see below:

Digital patch -p < patch_file

Pay special attention to the "-p digital", that is  patch_file  information about the file name listed inside.If the  patch_file The first line is written like this:

*** /home/guest/example/expatch.old

Then when I issued a "-p0 Patch <  patch_file  time", the updated file is "/home/guest/example/expatch.old" if "-p1 Patch <  patch_file ", the updated file to "home / guest / example / expatch.old "if" -p4 Patch <  patch_file "update" expatch.old ", that is to say, -pxx that xx stands for" remove several slash (/) "means! so you can understand right? well, according to data just on top, we can compare the file is found in the main-0.1 / xxx and main-0.2 / xxx, so if you are under the main-0.1, and you want to deal with updates, you have to remove a directory (because there is no main-0.2 directory exists, we are updated in the current directory!), so using -p1 fishes Oh!

 

Published 112 original articles · won praise 3 · Views 9731

Guess you like

Origin blog.csdn.net/yush34/article/details/103250917
Recommended