Patches
From Achievo/ATK Wiki
Search for differences between directories
With the default Unix diff command it is possible to compare files in two directories. See the diff --help page for all command options. Example to view the differences between two directories:
diff -Naur dir1 dir2
This will show the differences between dir1 and dir2 on the screen.
diff -Naur dir1 dir2 > myfile.patch
This will write the differences to the file myfile.patch.
Filter differences
It is very easy to filter a file with diff information by using the default Unix command filterdiff. See the filterdiff --help page for all command options. An example to save only the differences to language files to another file:
filterdiff -i '*.lng' myfile.patch > langupdates.patch
Making patches for Achievo
See also http://www.achievo.org/development/documentation/patch. When you made some changes or bug fix for Achievo or one of its modules, there is a very efficient way to send it to the developers.
First, let's assume you are using a Linux system or at least a UNIX based Operating System. If not... Well let's install one! Then let's also assume you kept an original copy of what you modified and you are modifying in another directory. (Tip: always make changes agains the latest CVS snapshot. This will make your patch easier to integrate into Achievo.)
Suppose you are making some changes to the 'weektimereg' module. weektimereg.org/ is your orginal copy and weektimereg/ is your working folder containing all your changes. What you need to do is put all your changes in a file, arrange it to help the developers know what you changed and where, all that always in the same format for everybody. The way to do so is to use "diff".
To make sure everybody use the same formating, we will use "diff -Naur".
So in our example, the exact syntax would be:
diff -Naur weektimereg.org/ weektimereg/
This will display a lot of text in the screen, so let's redirect that text in a file with:
diff -Naur weektimereg.org weektimereg > myPatchFile.patch
This file contains all the changes you made from weektimereg.org/* to weektimereg/* including all files in the subdirectories.
Well that is what it should be... You might want to make sure everything went well and all your changes are in the patch... So testing seems to be a good idea. In order to test you patch file, I would recommand to copy your original directory (cp -a weektimereg.org weektimereg.test). then copy your patch file in the new directory (cp myPatchFile.patch weektimereg.test/). Enter the new directory (cd weektimereg.test/). From there, you should be able to run:
patch -p1 < myPatchFile.patch
If everything went well, patch should tell you it did patch some files, so you are ready to test your patched Achievo! Just put it on a Web Server and make sure your modifications still works.
If you ran into some problems, you should have an error message and a ".rej" file in you new directory.