3 messages in com.mysql.lists.eventum-usersRe: How to find out where patches hav...| From | Sent On | Attachments |
|---|---|---|
| flem...@aon.dk | 07 Dec 2007 15:51 | |
| Stuart Tennant | 07 Dec 2007 23:38 | |
| Jorey Bump | 08 Dec 2007 11:21 |
| Subject: | Re: How to find out where patches have been applied to my setup? [Virus Checked]![]() |
|---|---|
| From: | Jorey Bump (li...@joreybump.com) |
| Date: | 12/08/2007 11:21:54 AM |
| List: | com.mysql.lists.eventum-users |
flem...@aon.dk wrote, at 12/07/2007 06:51 PM:
During the early setup of our current installation of Eventum, I added som patches, and a developer of mine have also made som changes in the current setup, but unfortunately the changes haven't been documented. I know it's a big mistake and I can only blame my self for being so stupid, not taking the time to do it in the proper way, instead of just going ahead using the changes.
Now here comes my question: can anyone tell me how to find the differences in my system, which are not part of the original setup ?
diff is your friend. Let's say you've patched the foo application. You have the vanilla source code in a directory named foo, and you want to compare it to your modified version, in a directory named foo.mod.
Show all changes:
diff -r foo foo.mod
View all changes in a pager:
diff -r foo foo.mod | less
Get a brief listing of affected files:
diff -r --brief foo foo.mod
Now that you know the affected files, you can open both versions in vimdiff and insert appropriate comments (I usually wrap each chunk with something like "LOCAL BEGIN" and "LOCAL END", so they're easy to find).
Create a unified diff that is compatible with the patch program:
diff -uNr foo foo.mod > patchfile
When you view the patchfile, you'll see all of the differences in context, denoting deleted/added lines with -/+. This is a nice way to keep a record of your changes or share the patch with someone. Let's say he saves the file to /tmp/patchfile:
cd /path/to/foo patch -p1 < /tmp/patchfile
Now his foo will be identical to your foo.mod (provided he's patching the exact same version of foo).
If you're feeling adventurous, you can even edit the patchfile to insert your comments, but you need to be very careful and adjust the range information (e.g. @@ -23,4 +23,7 @@) accordingly.
As always, play it safe and work on copies!
HTH, IDDW




