From owner-svn-ports-head@FreeBSD.ORG Fri Jul 19 15:27:27 2013 Return-Path: Delivered-To: svn-ports-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 153FBD10; Fri, 19 Jul 2013 15:27:27 +0000 (UTC) Date: Fri, 19 Jul 2013 15:27:27 +0000 From: Alexey Dokuchaev To: Johan van Selst Subject: Re: svn commit: r323302 - head/games/ltris Message-ID: <20130719152727.GA91182@FreeBSD.org> References: <201307191512.r6JFCl6U021741@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201307191512.r6JFCl6U021741@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-ports-head@freebsd.org, svn-ports-all@freebsd.org, ports-committers@freebsd.org X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jul 2013 15:27:27 -0000 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