Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 Jun 2002 12:10:02 +0300
From:      Maxim Sobolev <sobomax@FreeBSD.org>
To:        Trevor Johnson <trevor@jpj.net>, Juli Mallett <jmallett@FreeBSD.ORG>, Pete Fritchman <petef@absolutbsd.org>, portmgr@FreeBSD.ORG
Cc:        ports@FreeBSD.org
Subject:   Re: cvs commit: ports/Mk bsd.port.mk
Message-ID:  <3D0DA76A.D3C6CE27@FreeBSD.org>
References:  <20020614033017.I8221-100000@blues.jpj.net> <3D09DB11.8362727A@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3D0DA76A.D3C6CE27>