Путеводитель по Руководству Linux

  User  |  Syst  |  Libr  |  Device  |  Files  |  Other  |  Admin  |  Head  |



   patch    ( 1 )

применить файл сравнения к оригиналу (apply a diff file to an original)

Предостережение (Caveat)

Context diffs cannot reliably represent the creation or deletion
       of empty files, empty directories, or special files such as
       symbolic links.  Nor can they represent changes to file metadata
       like ownership, permissions, or whether one file is a hard link
       to another.  If changes like these are also required, separate
       instructions (e.g. a shell script) to accomplish them should
       accompany the patch.

patch cannot tell if the line numbers are off in an ed script, and can detect bad line numbers in a normal diff only when it finds a change or deletion. A context diff using fuzz factor 3 may have the same problem. You should probably do a context diff in these cases to see if the changes made sense. Of course, compiling without errors is a pretty good indication that the patch worked, but not always.

patch usually produces the correct results, even when it has to do a lot of guessing. However, the results are guaranteed to be correct only when the patch is applied to exactly the same version of the file that the patch was generated from.