Changeset View
Changeset View
Standalone View
Standalone View
en_US.ISO8859-1/books/porters-handbook/slow-porting/chapter.xml
Show First 20 Lines • Show All 409 Lines • ▼ Show 20 Lines | <sect2 xml:id="slow-patch-automatic-replacements"> | ||||
<title>Simple Automatic Replacements</title> | <title>Simple Automatic Replacements</title> | ||||
<para>Simple replacements can be performed directly from the | <para>Simple replacements can be performed directly from the | ||||
port <filename>Makefile</filename> using the in-place mode of | port <filename>Makefile</filename> using the in-place mode of | ||||
&man.sed.1;. This is useful when changes use the value of a | &man.sed.1;. This is useful when changes use the value of a | ||||
variable:</para> | variable:</para> | ||||
<programlisting>post-patch: | <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. Do | |||||
not use it to replace static content, use patch files for | |||||
adamw: This should be a semicolon, not a comma. | |||||
Done Inline ActionsThis seems off:
For me, semicolon is used to separate two non related clauses, which could be separate sentences. Here, the two clauses are related and the second emphasizes the first. mat: This seems off:
> Do not use it to replace static content; use patch files for that.
For me… | |||||
Done Inline ActionsThe problem is that with a comma, one of the clauses must be dependent (i.e. a non-complete sentence). Here, both clauses are complete sentences, making it what's called a "comma splice." I fully agree that the semicolon is weird there. Perhaps "You must use patch files instead of sed to replace static content." Or something like that. adamw: The problem is that with a comma, one of the clauses must be dependent (i.e. a non-complete… | |||||
that.</para> | |||||
</important> | |||||
<para>Quite often, software being ported uses the CR/LF | <para>Quite often, software being ported uses the CR/LF | ||||
convention in source files. This may cause problems with | convention in source files. This may cause problems with | ||||
further patching, compiler warnings, or script execution (like | further patching, compiler warnings, or script execution (like | ||||
<literal>/bin/sh^M not found</literal>.) To quickly convert | <literal>/bin/sh^M not found</literal>.) To quickly convert | ||||
all files from CR/LF to just LF, add this entry to the port | all files from CR/LF to just LF, add this entry to the port | ||||
<filename>Makefile</filename>:</para> | <filename>Makefile</filename>:</para> | ||||
▲ Show 20 Lines • Show All 138 Lines • Show Last 20 Lines |
This should be a semicolon, not a comma.