From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1QNq5F-0004H5-WC for garchives@archives.gentoo.org; Sat, 21 May 2011 17:35:26 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id B87881C042; Sat, 21 May 2011 17:35:16 +0000 (UTC) Received: from smtp-vbr19.xs4all.nl (smtp-vbr19.xs4all.nl [194.109.24.39]) by pigeon.gentoo.org (Postfix) with ESMTP id BEA43E02CB for ; Sat, 21 May 2011 17:34:40 +0000 (UTC) Received: from epia.jer-c2.orkz.net (D4B2706A.static.ziggozakelijk.nl [212.178.112.106]) (authenticated bits=0) by smtp-vbr19.xs4all.nl (8.13.8/8.13.8) with ESMTP id p4LHYcH0091378 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO) for ; Sat, 21 May 2011 19:34:39 +0200 (CEST) (envelope-from jer@gentoo.org) Date: Sat, 21 May 2011 19:34:34 +0200 From: Jeroen Roovers To: gentoo-dev@lists.gentoo.org Subject: Re: [gentoo-dev] RFC: sed script redundancy Message-ID: <20110521193434.3f623fa6@epia.jer-c2.orkz.net> In-Reply-To: <20110520155600.GB24801@gentoo.org> References: <20110520173922.391ea292@epia.jer-c2.orkz.net> <20110520155600.GB24801@gentoo.org> X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.1; i686-pc-linux-gnu) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: by XS4ALL Virus Scanner X-Archives-Salt: X-Archives-Hash: 6b4018800b8af04fd356dfb86d1807a7 On Fri, 20 May 2011 17:56:00 +0200 Fabian Groffen wrote: > sed -e "" "${file}" | diff "${file}" - > > followed by the actual sed -i -e ... > > This way I didn't need to write an intermediate file. The problem there is that sed might be called just once on any one file, but in the tree it is often invoked with multiple scripts, so this simple implementation lacks a way to evaluate which sed scripts are useful. Also, how do I ensure the sed replacement works only on invocations inside the ebuild, and not, say, in portage's internals? jer