Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Jun 2019 14:36:11 +0000 (UTC)
From:      Mathieu Arnold <mat@FreeBSD.org>
To:        doc-committers@freebsd.org, svn-doc-all@freebsd.org, svn-doc-head@freebsd.org
Subject:   svn commit: r53173 - in head/en_US.ISO8859-1/books/porters-handbook: makefiles slow-porting
Message-ID:  <201906201436.x5KEaBa0021580@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mat
Date: Thu Jun 20 14:36:11 2019
New Revision: 53173
URL: https://svnweb.freebsd.org/changeset/doc/53173

Log:
  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

Modified:
  head/en_US.ISO8859-1/books/porters-handbook/makefiles/chapter.xml
  head/en_US.ISO8859-1/books/porters-handbook/slow-porting/chapter.xml

Modified: head/en_US.ISO8859-1/books/porters-handbook/makefiles/chapter.xml
==============================================================================
--- head/en_US.ISO8859-1/books/porters-handbook/makefiles/chapter.xml	Thu Jun 20 11:33:28 2019	(r53172)
+++ head/en_US.ISO8859-1/books/porters-handbook/makefiles/chapter.xml	Thu Jun 20 14:36:11 2019	(r53173)
@@ -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>

Modified: head/en_US.ISO8859-1/books/porters-handbook/slow-porting/chapter.xml
==============================================================================
--- head/en_US.ISO8859-1/books/porters-handbook/slow-porting/chapter.xml	Thu Jun 20 11:33:28 2019	(r53172)
+++ head/en_US.ISO8859-1/books/porters-handbook/slow-porting/chapter.xml	Thu Jun 20 14:36:11 2019	(r53173)
@@ -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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201906201436.x5KEaBa0021580>