Creating a Drupal Patch
Update 2011-04-25: Creating patches has changed as Drupal has moved to GIT source control.
See:
http://drupal.org/node/707484
This was the old way to create a patch:
===================== OLD OLD OLD =====================
Here is a very cut down version of how to create a patch. See references below for more details.
Checkout the code.
cd sites/example.com/modules
cvs -z6 -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal-contrib checkout -d modulenamehere contributions/modules/modulenamehere
OR
cvs -z6 -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal-contrib checkout -r -d moduleName contributions/modules/moduleName
To get the correct version tag, visit the CVS contrib modules repo, choose your module, and pick one of the available NON-BRANCH tags from the dropdown list at the top of the page (such as DRUPAL-6--1-0).
Example:
cvs -z6 -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal-contrib checkout -r DRUPAL-6--1 -d datatables contributions/modules/datatables
Apply the modifications to the code.
Create the patch (I use w and B to ignore any whitespace of blank lines)
cd sites/example.com/modules/foobar
cvs diff -upwB > example.patch
Then test the patch. Put the original files back in place.
cd sites/example.com/modules/foobar
patch -p0 < example.patch
===================== OLD OLD OLD =====================
References:
http://drupal.org/node/321
http://drupal.org/patch/create
Comments