Skip to content
Permalink
Browse files

Remove misleading examples for patchfile naming

  • Loading branch information
raimue committed Mar 10, 2018
1 parent 340b1d9 commit 8690d0f287f8c03d51404147dac6d54503a401c2
Showing with 10 additions and 26 deletions.
  1. +4 −4 guide/xml/portfile-phase.xml
  2. +6 −22 guide/xml/portfiledev.xml
@@ -1436,11 +1436,11 @@ extract.post_args "| gnutar -x"</programlisting>
<listitem>
<para>Example:</para>

<programlisting>patchfiles patch-Makefile.in \
patch-source.c</programlisting>
<programlisting>patchfiles patch-destdir-variable-fix.diff \
patch-source.c.diff</programlisting>

<programlisting>patchfiles-append patch-configure
patchfiles-delete patch-src-Makefile.in</programlisting>
<programlisting>patchfiles-append patch-configure.diff
patchfiles-delete patch-destdir-variable-fix.diff</programlisting>
</listitem>
</itemizedlist>
</listitem>
@@ -596,25 +596,9 @@ variant sqlite description {Build sqlite support} {
logical change that needs to be applied. Patchfile filenames should
uniquely distinguish the file and generally be of the form
<filename>patch-</filename><replaceable>&lt;identifier&gt;</replaceable><filename>.diff</filename>,
where the <replaceable>identifier</replaceable> is a hint of what the
patch does. For example, this can be the filename of the patched file as in
<filename>patch-</filename><replaceable>src-Makefile.in</replaceable><filename>.diff</filename>.</para>

<para>You may use patch files that patch multiple files under these
conditions:</para>

<itemizedlist>
<listitem>
<para>You find existing patch files that do so.</para>
</listitem>

<listitem>
<para>If fixing a particular problem or bug requires changes in
multiple files the patch filename should reference
the problem or bug, for example:
<filename>patch-</filename><replaceable>destdir-variable-fix</replaceable><filename>.diff</filename></para>
</listitem>
</itemizedlist>
where the <replaceable>identifier</replaceable> is a reference to the
problem or bug it is supposed to solve. An example filename would be
<filename>patch-</filename><replaceable>destdir-variable-fix</replaceable><filename>.diff</filename>.</para>

<para>To create a patch to modify a single file, follow the steps
below.</para>
@@ -640,7 +624,7 @@ variant sqlite description {Build sqlite support} {
to create a <quote>unified</quote> diff patch file.</para>

<programlisting><prompt>%%</prompt> <userinput>cd ~/Downloads/foo-1.34</userinput>
<prompt>%%</prompt> <userinput>diff -u src/Makefile.in.orig src/Makefile.in &gt; patch-src-Makefile.in.diff</userinput></programlisting>
<prompt>%%</prompt> <userinput>diff -u src/Makefile.in.orig src/Makefile.in &gt; patch-destdir-variable-fix.diff</userinput></programlisting>

<para>You should execute <command>diff</command> from
the top-level directory of the unpacked source code, because during
@@ -683,15 +667,15 @@ variant sqlite description {Build sqlite support} {

<listitem>
<para>Place the patch
<filename>patch-src-Makefile.in.diff</filename> in the directory
<filename>patch-destdir-variable-fix.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 during development, or
<filename>files/</filename> may be in a port's
<varname>${portpath}</varname> in the global MacPorts
repository.</para>

<programlisting>patchfiles patch-src-Makefile.in.diff</programlisting>
<programlisting>patchfiles patch-destdir-variable-fix.diff</programlisting>
</listitem>
</orderedlist>
</section>

0 comments on commit 8690d0f

Please sign in to comment.
You can’t perform that action at this time.