How to apply a patch to scribus sourcecode

From Scribus Wiki
Jump to navigation Jump to search

And also "How to create a wellformed patch for scribus"

See :

Apply a patch

  • Get the patch. Usually you get download it off the Scribus bug tracker. Its extension is usually .diff or .patch
  • Look for the svn state (version) the patch has been created for. When the bug report doesnt specify this, you can deduce that approximately with the date the patch has been created : find it with dichotomy on websvn. Knowing this can be required because the patch fits a specified svn state, and might not be ok in a later state. This is particularly important for patches that modify lot of files, or files that change often, or that have been changed recently. In case you dont apply the patch to the corresponding svn state of scribus, you will have to manage conflicts. This is not covered in this how-to.
  • Checkout svn for that specific version, using the -r option
  • Go to your svn source folder and copy the patch file there
  • Apply the patch using the patch command.

When the patch file has been correctly prepared with normalized options, the following command should be ok :

patch -p1 < thepatchfile.patch

In case this is not OK, try

patch -p0 < thedifffile.patch

In case this is not OK, have a deeper look in the patch code and choose the better options.

Create a patch

Create a patch file out of your modified source, against svn version :

  • open a terminal in the 'svn' folder (not in the 'svn/scribus' folder).
  • create the patch using 'svn diff' command :
svn diff -x -u -x -w -x -b > nameofyourpatch.patch

For ease of use, your patch file name could mention

  • short description of core patch feature (footnotes_crash, undo_broken...)
  • bug number (it will help devs to track all the patches they have to try)
  • date submitted
  • possibly the name of the author
  • extension should be .diff

Example : footnotes_crash_12345_popol_2015_10_19.diff