From owner-svn-ports-head@FreeBSD.ORG Fri Aug 1 05:16:52 2014 Return-Path: Delivered-To: svn-ports-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id EA1B9EDC; Fri, 1 Aug 2014 05:16:52 +0000 (UTC) Date: Fri, 1 Aug 2014 05:16:52 +0000 From: Alexey Dokuchaev To: marino@freebsd.org Subject: Re: svn commit: r363361 - in head/editors/fte: . files Message-ID: <20140801051652.GA59625@FreeBSD.org> References: <41D25BC1-AC62-4280-A342-8A2BDD84B1E0@adamw.org> <20140730070412.GA97692@FreeBSD.org> <3898057.T8DsoXnEEp@mercury.ph.man.ac.uk> <53D89EBF.4080805@marino.st> <2D24420529C9ECAEABB9A791@atuin.in.mat.cc> <53D8A2BB.7090704@marino.st> <6270029E710D3C52B60B6224@atuin.in.mat.cc> <20140730081413.GA29876@FreeBSD.org> <20140730160843.GA2688@FreeBSD.org> <53D919BC.6010307@marino.st> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="tThc/1wpZn/ma/RB" Content-Disposition: inline In-Reply-To: <53D919BC.6010307@marino.st> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-ports-head@freebsd.org, Max Brazhnikov , svn-ports-all@freebsd.org, William Grzybowski , ports-committers@freebsd.org, Mathieu Arnold , Adam Weinberger X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.18 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, 01 Aug 2014 05:16:53 -0000 --tThc/1wpZn/ma/RB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Jul 30, 2014 at 06:13:48PM +0200, John Marino wrote: > On 7/30/2014 18:08, Alexey Dokuchaev wrote: > > Given some thought over it, I propose the following changes to makepatch: > > > > - default to dash (minus, '-') > > - provide a command line option (-s?) or make(1) variable (PATH_SEPARATOR) > > to override it when needed > > - assert that forced value is not something insane ('__', '::', '../../', > > etc.) -- basically, match it over a prerefined list of acceptable values > > > > I can cook up a patch unless John had beaten me on that already. > > Nope, go for it. Have a look (attached). I've also fixed annoying bug (appending of leading "./" in the ---/+++ lines of generated patches), and improved the comment. ./danfe --tThc/1wpZn/ma/RB Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="makepatch.diff" Index: /usr/ports/Mk/bsd.port.mk =================================================================== --- /usr/ports/Mk/bsd.port.mk (revision 363531) +++ /usr/ports/Mk/bsd.port.mk (working copy) @@ -1180,21 +1180,29 @@ .else -# Look for ${PATCH_WRKSRC}/.../*.orig files, and (re-)create -# ${FILEDIR}/patch-* files from them. +# Look for files named "*.orig" under ${PATCH_WRKSRC} and (re-)generate +# ${FILEDIR}/patch-* files from them. By default, '-' (dash, minus) is +# used to replace path separators in patch file names; it can be set to +# something else via PATCH_PATH_SEPARATOR variable (note that only [-+_] +# characters are allowed). .if !target(makepatch) +PATCH_PATH_SEPARATOR?= - makepatch: ${FILESDIR} +.if empty(PATCH_PATH_SEPARATOR) || ${PATCH_PATH_SEPARATOR:C/[-+_]//} + @${ECHO_MSG} "Error (${.TARGET}) PATCH_PATH_SEPARATOR must be one of the [-+_] characters." + @${FALSE} +.endif @(cd ${PATCH_WRKSRC}; \ for i in `find . -type f -name '*.orig'`; do \ - ORG=$$i; \ - NEW=$${i%.orig}; \ + ORG=$${i#./}; \ + NEW=$${ORG%.orig}; \ cmp -s $${ORG} $${NEW} && continue; \ - OUT=${FILESDIR}`${ECHO} $${NEW} | \ - ${SED} -e 's|/|__|g' \ - -e 's|^\.__|/patch-|'`; \ - ${ECHO} ${DIFF} -ud $${ORG} $${NEW} '>' $${OUT}; \ - ${DIFF} -ud $${ORG} $${NEW} > $${OUT} || ${TRUE}; \ + OUT=${FILESDIR}/`${ECHO} $${NEW} | \ + ${SED} -e 's|/|${PATCH_PATH_SEPARATOR}|g' \ + -e 's|^|patch-|'`; \ + ${ECHO} ${DIFF} -udp $${ORG} $${NEW} '>' $${OUT}; \ + ${DIFF} -udp $${ORG} $${NEW} > $${OUT} || ${TRUE}; \ done \ ) .endif --tThc/1wpZn/ma/RB--