From owner-cvs-all Fri Jun 14 10:38:51 2002 Delivered-To: cvs-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 931) id 040DA37B406; Fri, 14 Jun 2002 10:38:42 -0700 (PDT) Date: Fri, 14 Jun 2002 10:38:42 -0700 From: Juli Mallett To: Akinori MUSHA Cc: Trevor Johnson , Mikhail Teterin , Pete Fritchman , portmgr@freebsd.org, Maxim Sobolev , cvs-committers@freebsd.org, cvs-all@freebsd.org Subject: Re: cvs commit: ports/Mk bsd.port.mk Message-ID: <20020614103842.A92261@FreeBSD.ORG> References: <200206141102.50292.mi+mx@aldan.algebra.com> <20020614113752.K11520-100000@blues.jpj.net> <86k7p16c4q.wl@archon.local.idaemons.org> <20020614101409.A88549@FreeBSD.ORG> <86hek56abw.wl@archon.local.idaemons.org> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.2.5.1i In-Reply-To: <86hek56abw.wl@archon.local.idaemons.org>; from knu@iDaemons.org on Sat, Jun 15, 2002 at 02:26:11AM +0900 Organisation: The FreeBSD Project X-Alternate-Addresses: , , , X-Affiliated-Projects: FreeBSD, xMach, ircd-hybrid-7 X-Towel: Yes 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 * Akinori MUSHA escriurères > At Fri, 14 Jun 2002 10:14:10 -0700, > Juli Mallett wrote: > > sed 's/foo/bar/;s/blah/bleh/' file | tee file > /dev/null > > Surely that'll work, but it has to be a single command to be used in > the ports infrastructure, no? Well, could be done via a make(1) rule, maybe? Aside that, no because you could use some :: rules generated by some definitions. .if defined(REGEX_REPLACE) .for file in ${REGEX_REPLACE_FILES} regex-replace:: .if defined(REGEX_REPLACE_${file}) sed ${REGEX_REPLACE_${file}} ${file} | tee ${file} > /dev/null .else sed ${REGEX_REPLACE} ${file} | tee ${file} > /dev/null .endif .endfor .endif .if target(regex-replace) all: regex-replace .endif And then in a Makefile, REGEX_REPLACE= s/foo/bar/ REGEX_REPLACE_foo.c= s/barf/blah/ REGEX_REPLACE_FILES= foo.c bar.blah heh.hoh dum.di.dum Or similar? Of course I'm not how sure that "surely" that will work, because I haven't read tee(1)'s code in a long time, but something along those lines is not hard. -- Juli Mallett FreeBSD: The Power To Serve Perception is prejudice / Don't classify me / Accept me as me / Not what you see To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message