31,028
edits
| Line 128: | Line 128: | ||
''For Windows:'' | ''For Windows:'' | ||
If you work on Windows, another method (not so nice than previous) is also possible. Install the open source compare tools called Winmerge (this tool is able to build patch with format ''diff -Naur''). Then compare with WinMerge the reference file and modified file and choose in menu ''"Tools - Generate patch"''. Add an output filename like ''"mypatch.patch"'', click on box ''"Append"'' and hcoose option ''"Format Unified"''. Then click on ''"Ok"''. | If you work on Windows, another method (not so nice than previous) is also possible. Install the open source compare tools called Winmerge (this tool is able to build patch with format ''diff -Naur''). Then compare with WinMerge the reference file and modified file and choose in menu ''"Tools - Generate patch"''. Add an output filename like ''"mypatch.patch"'', click on box ''"Append"'' and hcoose option ''"Format Unified"''. Then click on ''"Ok"''. | ||
Eventually restart for each modified file. | Eventually restart for each modified file. | ||
Finally, you will get a file ''mypatch.patch'' that contains all changes with goode format. | Finally, you will get a file ''mypatch.patch'' that contains all changes with goode format. | ||
'''Apply a patch''' | * '''Apply a patch''' | ||
If you want to apply a patch file on an old version to have a new one modified by the path file, this is possible with the '''patch''' tool. | |||
Imagine you have on non modified version somewhere on a server. Put you patch file into the root directory. Go into this root directory then launch the command: | |||
patch -u -p0 -d . | patch -u -p0 -d . < mypatch.patch | ||
<nowiki> | <nowiki>For information: -p0 is to use full path of files defined in patch file to locate them on your disk (-pn will remove the n first levels of directories) | ||
-d | -d define the relative path do directory to patch. | ||
< | < is to provide source file name to use (patch must have format previsouly defined) | ||
-u | -u is to tell that patch has unified format</nowiki> | ||
= How to package and deploy a module = | = How to package and deploy a module = | ||