From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754948AbZEYNFy (ORCPT ); Mon, 25 May 2009 09:05:54 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754713AbZEYNFW (ORCPT ); Mon, 25 May 2009 09:05:22 -0400 Received: from one.firstfloor.org ([213.235.205.2]:60057 "EHLO one.firstfloor.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754723AbZEYNFV (ORCPT ); Mon, 25 May 2009 09:05:21 -0400 Date: Mon, 25 May 2009 15:11:44 +0200 From: Andi Kleen To: Michal Marek Cc: Andi Kleen , Sam Ravnborg , linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/3] kbuild: handle non-existing options in scripts/config Message-ID: <20090525131144.GZ846@one.firstfloor.org> References: <20090525125540.GB12943@sepie.suse.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090525125540.GB12943@sepie.suse.cz> User-Agent: Mutt/1.4.2.1i Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > -replace() { > - sed -i -e "$@" $FN > +# set_var name value [before-var] > +set_var() { > + awk -vvar="$1" -vnew="$2" -vbefore="$3" ' This seems rather complicated compared to what was there before. I would just cmp the output file to the input file and if they are the same then add it at the end with a echo > + } > + ' "$FN" >"$FN.tmp" This should be a &&, otherwise you risk removing the output file on ctrl-c -Andi -- ak@linux.intel.com -- Speaking for myself only.