Difference between revisions of "How to apply a patch to scribus sourcecode"

From Scribus Wiki
Jump to: navigation, search
(Apply a patch)
(Create a patch)
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
[[Category:Development]][[Category:FAQ]][[Category:Testing]]
 
[[Category:Development]][[Category:FAQ]][[Category:Testing]]
 +
 +
<big>And also "How to create a wellformed patch for scribus"</big>
 +
 
See : http://jungels.net/articles/diff-patch-ten-minutes.html
 
See : http://jungels.net/articles/diff-patch-ten-minutes.html
  
Line 14: Line 17:
 
* Apply the patch using the patch command.
 
* Apply the patch using the patch command.
 
When the patch file has been correctly prepared with normalized options, the following command should be ok :
 
When the patch file has been correctly prepared with normalized options, the following command should be ok :
patch -p1 < thepatchfile.patch
+
<pre>patch -p1 < thepatchfile.patch</pre>
In case this is not OK, try patch -p0 <stiff.patch
+
 
 +
In case this is not OK, try <pre>patch -p0 < thedifffile.patch</pre>
 +
 
 
In case this is not OK, have a deeper look in the patch code and choose the better options.
 
In case this is not OK, have a deeper look in the patch code and choose the better options.
  
Line 22: Line 27:
 
Create a patch file out of your modified source, against svn version :
 
Create a patch file out of your modified source, against svn version :
  
svn diff -x -u -x -w -x -b > nameofyourpatch.patch
+
* open a terminal in the 'svn' folder (not in the 'svn/scribus' folder).
 +
* create the patch using 'svn diff' command :
 +
<pre>svn diff -x -u -x -w -x -b > nameofyourpatch.patch</pre>
 +
 
 +
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
  
 
==== Links ====
 
==== Links ====

Latest revision as of 16:13, 22 October 2015


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

See : http://jungels.net/articles/diff-patch-ten-minutes.html

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

Links