Changeset 29107 for trunk/doc


Ignore:
Timestamp:
Sep 15, 2007, 6:57:36 AM (12 years ago)
Author:
markd@…
Message:

Refine patch section; add a TODO item in "best practices" section.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/guide/new/xml/portfiledev.xml

    r28918 r29107  
    515515        <listitem>
    516516          <para>Now use the Unix command <command>diff -u </command>to create
    517           a "unified" diff patch file. Name the patchfile
    518           appropriately.</para>
     517          a "unified" diff patch file. Put the name of the port in the
     518          patchfile, for example, Portfile-rrdtool.diff.</para>
    519519
    520520          <programlisting><prompt>%%</prompt> <userinput>diff -u Portfile.orig Portfile &gt; Portfile-rrdtool.diff</userinput></programlisting>
     
    616616          <filename>patch-Makefile.in</filename> in the path ${portpath}/files
    617617          of a local repository (or commit it to subversion) and use it in a
    618           port using the patchfiles keyword.</para>
     618          port using the <code>patchfiles</code> keyword.</para>
    619619
    620620          <programlisting>patchfiles              patch-Makefile.in</programlisting>
     621
     622          <note>
     623            <para>You should make a patch file for each file to be patched,
     624            though if you obtain a patch from another source that patches
     625            multiple files it is permissible to use it that way. Patch
     626            filenames should generally be of the form
     627            "patch-&lt;directory&gt;-&lt;filename&gt;", for example
     628            <filename>patch-src-Makefile.in</filename>.</para>
     629          </note>
    621630        </listitem>
    622631      </orderedlist>
     
    627636
    628637      <para>Though MacPorts applies patch files automatically, you may want to
    629       know how to apply patch files manually if you want to apply uncommitted
    630       Portfile patches or other similar uses.</para>
     638      know how to apply patch files manually if you want to test patch files
     639      you have created or you wish to apply uncommitted Portfile
     640      patches.</para>
    631641
    632642      <orderedlist>
     
    643653          patchfile knows the filename of the file to be patched.</para>
    644654
    645           <programlisting><prompt>%%</prompt> <userinput>patch &lt; ~/Desktop/Portfile.diff</userinput></programlisting>
     655          <programlisting><prompt>%%</prompt> <userinput>patch -p0 &lt; ~/Desktop/Portfile-postfix.diff</userinput></programlisting>
    646656
    647657          <screen>patching file Portfile</screen>
     
    661671      <title>Don't Overwrite Config Files</title>
    662672
    663       <para></para>
     673      <para>TODO:</para>
    664674    </section>
    665675
     
    667677      <title>Install Docs and Examples</title>
    668678
    669       <para></para>
     679      <para>TODO:</para>
    670680    </section>
    671681
     
    673683      <title>Provide User Messages</title>
    674684
    675       <para></para>
     685      <para>TODO:</para>
     686    </section>
     687
     688    <section>
     689      <title>Use Variables</title>
     690
     691      <para>TODO: Set variables so changing paths may be done in one place;
     692      use them anytime it makes updates simpler: distname
     693      ${name}-src-${version}</para>
    676694    </section>
    677695  </section>
Note: See TracChangeset for help on using the changeset viewer.