<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to Apply_a_patch</title><link>https://sourceforge.net/p/plplot/wiki/Apply_a_patch/</link><description>Recent changes to Apply_a_patch</description><atom:link href="https://sourceforge.net/p/plplot/wiki/Apply_a_patch/feed" rel="self"/><language>en</language><lastBuildDate>Thu, 01 Nov 2018 21:43:44 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/plplot/wiki/Apply_a_patch/feed" rel="self" type="application/rss+xml"/><item><title>Apply_a_patch modified by Alan W. Irwin</title><link>https://sourceforge.net/p/plplot/wiki/Apply_a_patch/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v2
+++ v3
@@ -1,3 +1,15 @@
+
+
 The key elements to pay attention to with the patch application are to make sure you are in the proper directory within the source tree, and the --dry-run and -p options for patch such as -p0, -p1, etc. Basically, the number after the -p option is the number of subdirectory prefixes to strip off the file names in the patch. Hez's current patch has file names a/drivers/cairo.c and b/drivers/cairo.c so you apply -p1 to strip off just the a/ and b/ from the names and patch will find drivers/cairo.c to patch _IF_ you are in the top-level of the source tree. However, if you are in the drivers subdirectory of the source tree, then you have to use -p2 to strip off a/drivers/ and b/drivers from the cairo.c name. Hope that makes sense. The --dry-run option lets you know (a) whether the files to be patched can be found (i.e., whether you are in a directory that is consistent with the -p option you have used), and (b) whether the patch applies cleanly to those files (without actually applying the patch). In any case just remember that --dry-run gives you a chance to experiment with different -p numbers until you discover the correct one for the directory that you are in.

 Here is how I discovered that Hez's patch would apply cleanly (without actually patching cairo.c)
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Alan W. Irwin</dc:creator><pubDate>Thu, 01 Nov 2018 21:43:44 -0000</pubDate><guid>https://sourceforge.netbf2194f06b65a98554df68daee131e4e9ecc1ac0</guid></item><item><title>Apply_a_patch modified by Alan W. Irwin</title><link>https://sourceforge.net/p/plplot/wiki/Apply_a_patch/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Alan W. Irwin</dc:creator><pubDate>Sun, 05 Oct 2014 18:59:55 -0000</pubDate><guid>https://sourceforge.net8e27087f91e3f538c5aaaa10a6d000277d1cfb4e</guid></item><item><title>Apply_a_patch modified by Alan W. Irwin</title><link>https://sourceforge.net/p/plplot/wiki/Apply_a_patch/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;The key elements to pay attention to with the patch application are to make sure you are in the proper directory within the source tree, and the --dry-run and -p options for patch such as -p0, -p1, etc. Basically, the number after the -p option is the number of subdirectory prefixes to strip off the file names in the patch. Hez's current patch has file names a/drivers/cairo.c and b/drivers/cairo.c so you apply -p1 to strip off just the a/ and b/ from the names and patch will find drivers/cairo.c to patch &lt;em&gt;IF&lt;/em&gt; you are in the top-level of the source tree. However, if you are in the drivers subdirectory of the source tree, then you have to use -p2 to strip off a/drivers/ and b/drivers from the cairo.c name. Hope that makes sense. The --dry-run option lets you know (a) whether the files to be patched can be found (i.e., whether you are in a directory that is consistent with the -p option you have used), and (b) whether the patch applies cleanly to those files (without actually applying the patch). In any case just remember that --dry-run gives you a chance to experiment with different -p numbers until you discover the correct one for the directory that you are in.&lt;/p&gt;
&lt;p&gt;Here is how I discovered that Hez's patch would apply cleanly (without actually patching cairo.c)&lt;/p&gt;
&lt;p&gt;&lt;code&gt;software@raven&amp;gt; patch --dry-run -p1 \&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&amp;lt; /home/irwin/cairo-xcairo-offscreen-rendering-v2.patch&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;patching file drivers/cairo.c&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;The lack of further messages after the "patching file" message indicates the file was found and the patch would apply cleanly. Remove the --dry-run option when you actually are ready to apply the patch. After you apply the patch and evaluate it, you might want to remove it again from your source tree . For that, you use the --reverse option of patch (which reverses the effect of the patch). Of course, again, you would first want to use the --dry-run and --reverse options combined to make sure you are in the right directory with a consistent -p number used before you remove the --dry-run option.&lt;/p&gt;
&lt;p&gt;The content of this page is available under the &lt;a class="" href="http://www.gnu.org/copyleft/fdl.html" rel="nofollow"&gt;GNU Free Documentation License 1.2&lt;/a&gt;.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Alan W. Irwin</dc:creator><pubDate>Wed, 01 Oct 2014 22:12:32 -0000</pubDate><guid>https://sourceforge.net2f2c7e75acc5bb2e847ba1088d772eb99542585b</guid></item></channel></rss>