Date: Fri, 19 Jul 2013 15:27:27 +0000 From: Alexey Dokuchaev <danfe@FreeBSD.org> To: Johan van Selst <johans@FreeBSD.org> Cc: svn-ports-head@freebsd.org, svn-ports-all@freebsd.org, ports-committers@freebsd.org Subject: Re: svn commit: r323302 - head/games/ltris Message-ID: <20130719152727.GA91182@FreeBSD.org> In-Reply-To: <201307191512.r6JFCl6U021741@svn.freebsd.org> References: <201307191512.r6JFCl6U021741@svn.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Jul 19, 2013 at 03:12:47PM +0000, Johan van Selst wrote: > New Revision: 323302 > URL: http://svnweb.freebsd.org/changeset/ports/323302 > > Log: > Use slashes as regex separators everywhere for consistency > > Suggested by: danfe Well, thanks, but... (see below) > @@ -28,9 +28,9 @@ PLIST_SUB+= NLS="@comment " > .endif > > post-patch: > - @${REINPLACE_CMD} -e 's|/icons|/pixmaps|g' ${WRKSRC}/Makefile.in > - @${REINPLACE_CMD} -e 's|= @mixer_flag@|= @INTLLIBS@ @mixer_flag@|g ; \ > - s|--mode=666||g' ${WRKSRC}/src/Makefile.in > + @${REINPLACE_CMD} -e 's/\/icons/\/pixmaps/g' ${WRKSRC}/Makefile.in > + @${REINPLACE_CMD} -e 's/= @mixer_flag@/= @INTLLIBS@ @mixer_flag@/g ; \ > + s/--mode=666//g' ${WRKSRC}/src/Makefile.in The reason people are using commas, bars, carets, pluses, etc. for regex separation is because these characters are less likely to clash with the ones present in the search string. Most notably, (and that's very well illustrated by this example), is to avoid escaping slashes when dealing with paths (which use slashes as separators in Unix). My original point was not that you have to change it to slashes, but only be consistent within the Makefile. For example: I would usually use , (comma) or | (bar); when there's a clash (like when I have to patch some function call, which uses comma for parameter separation), I may choose ^ (caret), or + (plus), or even @ (comm. "at") to avoid escaping. Escaping should be avoided as it is error-prone and generally harder to read and comprehend. That said, in each particular case, the best char for s-expression should be selected on per-case basis, wisely. ./danfe
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130719152727.GA91182>