svn commit: r53173 - in head/en_US.ISO8859-1/books/porters-handbook: makefiles slow-porting

Mathieu Arnold <[email protected]>
Newsgroups gmane.os.freebsd.devel.cvs.doc
Message-ID <[email protected]>
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
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-doc-all
To unsubscribe, send any mail to "[email protected]"
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.