Spice+ logo


Main
  Homepage
  Status
  Download
  Donate

Development
• Build your patch
  Contribution

  Links


Build your patch


To create a patch you need two version of each modified file, the original version and your modified version. You also need the "diff" tool, which is used to create the patches, and "patch", which is used to apply the patches to the original version.

If you are planning to modify only one file, you will usually copy this file to the same name in the same directory with the appended extension '.old' before starting to work on it. After you have made your modifications to the file, and verified that they please you, go to the directory containing the modified and original files and type at the prompt

diff -u file.c.old file.c > file.diff

This command will generate a text file which contains the differences between both files in unified output format. Open it with your prefered editor and verify that it contains the modifications you wanted to do: lines you have added will be marked with a plus sign '+', lines you have removed will be marked with a minus sign '-'. If the file is bigger than a few kilobytes, compress it before sending, and of course remember to add an explanation of what the patch is meant to do, why it's needed, and any other information you consider relevant.

If the modifications you want to do are scattered through several files and/or directories, you need to create a copy of Spice+ source. If you have extracted the original files in "spicep07" directory, create a copy of this directory and all the files present in it, named for example "spicep07mod", so as to obtain two complete sources trees side by side. Modify the files you wish in "spicep07mod". Once you are finished, go back to the parent directory housing the two source trees and type:

diff -ur spicep07 spicep07mod > spice07.diff

The '-r' switch makes "diff" compare directories recursively. Again, do the previous steps of verifying your patch, compressing and sending with correct instructions. If your patch adds or removes files, you will have to add the '-N' switch, because by default diff will ignore files which are only in one of the trees. Of course, you might want to run a 'make clean' in your working directory before running this command, or you will include lots of generated files which have nothing to do with your patch. Or you could edit the resulting patch, but that can be error prone.











Send comments and suggestions to
Email
SourceForge Logo