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

From Scribus Wiki
Jump to: navigation, search
(explain and clean)
(Apply a patch)
Line 6: Line 6:
 
* Get the patch. Usually you get download it off the [http://bugs.scribus.net Scribus bug tracker]. Its extension is usually .diff or .patch
 
* Get the patch. Usually you get download it off the [http://bugs.scribus.net Scribus bug tracker]. Its extension is usually .diff or .patch
  
* Look for the date the patch has been created and deduce the svn version that was used to create the patch : 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.
+
* Look for the svn state (version) the patch has been created for. You can deduce that from the date the patch has been created, using http://scribus.net/websvn/listing.php?repname=Scribus&path=%2Ftrunk%2FScribus%2F&#afc6df6bef95b63610fa9181ee0ae044a. This can 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
 
* Checkout svn for that specific version, using the -r option
  
* go to your svn source folder and copy the patch file there
+
* Go to your svn source folder and copy the patch file there
  
 
* 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
 
patch -p1 < thepatchfile.patch
 
  
 
==== Create a patch ====
 
==== Create a patch ====

Revision as of 16:00, 17 October 2014

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. You can deduce that from the date the patch has been created, using http://scribus.net/websvn/listing.php?repname=Scribus&path=%2Ftrunk%2FScribus%2F&#afc6df6bef95b63610fa9181ee0ae044a. This can 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

Create a patch

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

svn diff -x -u -x -w -x -b > nameofyourpatch.patch


Links