Patching Python files
Hi all,
I modified some existing Python files. Now I like to write some patching script which patches identical files with my modifications. I could of course pull a dirty trick by overwriting the originals by the new files, but I'd prefer to use a pretty patching technique. I think the linux "patch" tool can help me here, but I realy can't figure out how to do this in a good way. Can anybody give me a good tip or perhaps some tutorial how to make good patches? Of course, information on other techniques is interesting too. Thanks in advance, Robin |
(Note diff does line by line comparisons, so will only work with text, not binary.)
Have (a copy of) the original and the modified file in the same directory. Do "diff -Naur original_file modified_file > modification.diff" to get the changes between them in a file. Now if you want to modify the original you would "patch original_file < modification.diff". Done. |
Quote:
|
All times are GMT -5. The time now is 02:33 PM. |