From owner-cvs-all Mon Jun 17 2: 9:27 2002 Delivered-To: cvs-all@freebsd.org Received: from sdns.kv.ukrtel.net (sdns.kv.ukrtel.net [195.5.27.246]) by hub.freebsd.org (Postfix) with ESMTP id 1EDA037B40F; Mon, 17 Jun 2002 02:09:10 -0700 (PDT) Received: from vega.vega.com (195.5.51.243 [195.5.51.243]) by sdns.kv.ukrtel.net with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2650.21) id M7SJ6L8G; Mon, 17 Jun 2002 12:11:13 +0300 Received: from FreeBSD.org (big_brother.vega.com [192.168.1.1]) by vega.vega.com (8.11.6/8.11.3) with ESMTP id g5H993b22812; Mon, 17 Jun 2002 12:09:03 +0300 (EEST) (envelope-from sobomax@FreeBSD.org) Message-ID: <3D0DA76A.D3C6CE27@FreeBSD.org> Date: Mon, 17 Jun 2002 12:10:02 +0300 From: Maxim Sobolev Organization: Vega International Capital X-Mailer: Mozilla 4.79 [en] (Windows NT 5.0; U) X-Accept-Language: en,uk,ru MIME-Version: 1.0 To: Trevor Johnson , Juli Mallett , Pete Fritchman , portmgr@FreeBSD.ORG Cc: ports@FreeBSD.org Subject: Re: cvs commit: ports/Mk bsd.port.mk References: <20020614033017.I8221-100000@blues.jpj.net> <3D09DB11.8362727A@FreeBSD.org> Content-Type: multipart/mixed; boundary="------------3C3180A8375A26F21D7A7791" Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG This is a multi-part message in MIME format. --------------3C3180A8375A26F21D7A7791 Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 7bit Maxim Sobolev wrote: > > Trevor Johnson wrote: > > > > Juli Mallett wrote: > > > > > Anyway, it's on my list of things to MFC, but it was controversial when it was > > > on the tip of my mind, and I had trivial stuff I was having trouble getting to > > > the RELENG_4 branch during the freeze, so I decided I'd wait for the free for > > > all. I'd like to see ports move over to using it once it's been MFC'd for a > > > while... > > > > Suppose there were a port, call it ports/misc/46upgrade, which installed > > jmallett's sed, either as "jsed" or as just plain "sed" (in the latter > > case, it would /usr/bin/sed aside on installation, and back in place on > > deinstallation). Suppose the jsed port bumped /var/db/port.mkversion and > > bsd.port.mk checked for this ("your system is too old to use this > > bsd.port.mk") Then the macro for patching in situ could always use > > jmallett's sed, never perl. It would behave consistently across different > > versions of FreeBSD, so it would be easier to test and debug. > > I should admit that it looks like the most realistic plan out there. > The main problems are with $ and @ characters, which have a special > meaning for perl but no such meaning for sed(1), so that any, even > simple, regexp that uses those chars *could not* be modified to work > uniformly with both perl and sed. I've just added textproc/sed_inplace port, which is essentially sed(1) snapshot from FreeBSD cvs. Attached patch should allow to automagically use this port on systems which don't have sed capable of doing in-place editing, so that there will be no sed vs. perl regex nightmare. It also allows people to override sed(1) args to change extension of backup file or get rid of it completely. What do people think about it? May I commit it without doing the full bento build first? -Maxim --------------3C3180A8375A26F21D7A7791 Content-Type: text/plain; charset=koi8-r; name="bsd.port.mk.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="bsd.port.mk.diff" Index: bsd.port.mk =================================================================== RCS file: /home/ncvs/ports/Mk/bsd.port.mk,v retrieving revision 1.414 diff -d -u -r1.414 bsd.port.mk --- bsd.port.mk 13 Jun 2002 18:20:40 -0000 1.414 +++ bsd.port.mk 17 Jun 2002 09:06:22 -0000 @@ -623,13 +623,6 @@ .endif .endif -# Special macro for doing in-place file editing using regexps -.if ${OSVERSION} <= 500033 -REINPLACE_CMD?= ${PERL} -p -i.bak -.else -REINPLACE_CMD?= ${SED} -i.bak -.endif - # Get the object format. .if !defined(PORTOBJFORMAT) PORTOBJFORMAT!= test -x /usr/bin/objformat && /usr/bin/objformat || echo aout @@ -716,6 +709,17 @@ SCRIPTDIR?= ${MASTERDIR}/scripts PKGDIR?= ${MASTERDIR} +# Special macro for doing in-place file editing using regexps +.if defined(USE_REINPLACE) +REINPLACE_ARGS?= -i.bak +.if ${OSVERSION} <= 500033 +BUILD_DEPENDS+= ${LOCALBASE}/bin/sed_inplace:${PORTSDIR}/textproc/sed_inplace +REINPLACE_CMD?= ${LOCALBASE}/bin/sed_inplace ${REINPLACE_ARGS} +.else +REINPLACE_CMD?= ${SED} ${REINPLACE_ARGS} +.endif +.endif + .if defined(USE_IMAKE) && !defined(USE_X_PREFIX) USE_X_PREFIX= yes .endif --------------3C3180A8375A26F21D7A7791-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message