[37419] trunk/doc-new/guide/xml/portfiledev.xml

markd at macports.org markd at macports.org
Fri Jun 6 16:10:53 PDT 2008


Revision: 37419
          http://trac.macosforge.org/projects/macports/changeset/37419
Author:   markd at macports.org
Date:     2008-06-06 16:10:52 -0700 (Fri, 06 Jun 2008)

Log Message:
-----------
Add patchfile details from portstyle.7.

Modified Paths:
--------------
    trunk/doc-new/guide/xml/portfiledev.xml

Modified: trunk/doc-new/guide/xml/portfiledev.xml
===================================================================
--- trunk/doc-new/guide/xml/portfiledev.xml	2008-06-06 22:29:17 UTC (rev 37418)
+++ trunk/doc-new/guide/xml/portfiledev.xml	2008-06-06 23:10:52 UTC (rev 37419)
@@ -519,11 +519,21 @@
     <section id="development.patches.source">
       <title>Creating Source Code Patches</title>
 
-      <para>Necessary or useful patches to application source code should be
-      sent to the application developer (not the port author) so the
-      modifications may be included in the next version; then the port patch
-      may be removed after an updated tarball is released.</para>
+      <para>Necessary or useful patches to application source code should
+      generally be sent to the application developer rather than the port
+      author so the modifications may be included in the next version of the
+      application.</para>
 
+      <para>You should create one patch file for each file to be patched,
+      though it is permissible to use existing patches you find that patch
+      multiple files. Patchfile filenames should uniquely distinguish the file
+      and generally be of the form
+      <filename>patch-</filename><replaceable>&lt;directory&gt;</replaceable>-<replaceable>&lt;filename&gt;.diff</replaceable>,
+      as shown in this example:
+      <filename>patch-src-Makefile.in.diff</filename>. Patch files should
+      apply with "patch -p0'' from the working source directory of the
+      port.</para>
+
       <orderedlist>
         <listitem>
           <para>Locate the file you wish to patch in its original location
@@ -544,13 +554,13 @@
           a "unified" diff patch file.</para>
 
           <programlisting><prompt>%%</prompt> <userinput>cd foo-1.34</userinput>
-<prompt>%%</prompt> <userinput>diff -u Makefile.in.orig Makefile.in &gt; patch-Makefile.in</userinput></programlisting>
+<prompt>%%</prompt> <userinput>diff -u Makefile.in.orig Makefile.in &gt; patch-Makefile.in.diff</userinput></programlisting>
 
           <note>
             <para>You must execute the <command>diff</command> command in the
             top-level of the unpacked source code. Otherwise the
             <command>patch</command> command will look for the file to be
-            patched in the wrong place and fail.</para>
+            patched in the wrong path and fail.</para>
           </note>
         </listitem>
 
@@ -574,23 +584,14 @@
         </listitem>
 
         <listitem>
-          <para>Now you may place the patch
-          <filename>patch-Makefile.in</filename> in the directory
-          <varname>${portpath}</varname>/files (either a local repository or
-          after committing to the MacPorts Subversion port repository) and use
-          it in a port using the <code>patchfiles</code> keyword.</para>
+          <para>Place the patch <filename>patch-Makefile.in.diff</filename> in
+          the directory <filename>${portpath}/files</filename> and use it in a
+          port using the <code>patchfiles</code> keyword.
+          <varname>${portpath}</varname> may be in a local Portfile repository
+          for development purposes, or the patch may be committed to the
+          global MacPorts repository for distribution.</para>
 
           <programlisting>patchfiles          patch-Makefile.in</programlisting>
-
-          <note>
-            <para>You should create one patch file for each file to be
-            patched, though it is permissible to use existing patches you find
-            that patch multiple files. Patchfile filenames should generally be
-            of the form
-            <filename>patch-</filename><replaceable>&lt;directory&gt;</replaceable>-<replaceable>&lt;filename&gt;</replaceable>,
-            as shown in this example:
-            <filename>patch-src-Makefile.in</filename>.</para>
-          </note>
         </listitem>
       </orderedlist>
     </section>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20080606/8094fd8f/attachment.htm 


More information about the macports-changes mailing list