Make it clear that using sed(1) to patch files is only to be used when

replacing variable content.

Reported by:	swills
Reviewed by:	adamw
Differential Revision:	https://reviews.freebsd.org/D20679
This commit is contained in:
Mathieu Arnold 2019-06-20 14:36:11 +00:00
parent e6150df763
commit abaaf4e291
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=53173
2 changed files with 11 additions and 9 deletions

View file

@ -7581,14 +7581,11 @@ DOCS_ALL_TARGET= doc</programlisting>
<programlisting>OPTIONS_DEFINE= OPT1
post-patch:
@${REINPLACE_CMD} -e 's/echo/true/' ${WRKSRC}/Makefile
post-patch-OPT1-on:
@${REINPLACE_CMD} -e '/opt1/d' ${WRKSRC}/Makefile
@${REINPLACE_CMD} -e '/opt1/s|/usr/bin/|${EXAMPLESDIR}/|' ${WRKSRC}/Makefile
post-patch-OPT1-off:
@${REINPLACE_CMD} -e '/opt1/s|/usr/bin/|${LOCALBASE}/bin/|' ${WRKSRC}/Makefile</programlisting>
@${REINPLACE_CMD} -e '/opt1/s|/usr/bin/|${PREFIX}/bin/|' ${WRKSRC}/Makefile</programlisting>
<para>is equivalent to:</para>
@ -7597,11 +7594,10 @@ post-patch-OPT1-off:
.include &lt;bsd.port.options.mk&gt;
post-patch:
@${REINPLACE_CMD} -e 's/echo/true/' ${WRKSRC}/Makefile
.if ${PORT_OPTIONS:MOPT1}
@${REINPLACE_CMD} -e '/opt1/d' ${WRKSRC}/Makefile
@${REINPLACE_CMD} -e '/opt1/s|/usr/bin/|${EXAMPLESDIR}/|' ${WRKSRC}/Makefile
.else
@${REINPLACE_CMD} -e '/opt1/s|/usr/bin/|${LOCALBASE}/bin/|' ${WRKSRC}/Makefile
@${REINPLACE_CMD} -e '/opt1/s|/usr/bin/|${PREFIX}/bin/|' ${WRKSRC}/Makefile
.endif</programlisting>
</sect3>
</sect2>

View file

@ -415,7 +415,13 @@
variable:</para>
<programlisting>post-patch:
@${REINPLACE_CMD} -e 's|for Linux|for FreeBSD|g' ${WRKSRC}/README</programlisting>
@${REINPLACE_CMD} -e 's|/usr/local|${PREFIX}|g' ${WRKSRC}/Makefile</programlisting>
<important>
<para>Only use &man.sed.1; to replace variable content. You
must use patch files instead of &man.sed.1; to replace
static content.</para>
</important>
<para>Quite often, software being ported uses the CR/LF
convention in source files. This may cause problems with