From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751990AbbCKKQP (ORCPT ); Wed, 11 Mar 2015 06:16:15 -0400 Received: from cantor2.suse.de ([195.135.220.15]:43056 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750852AbbCKKQN (ORCPT ); Wed, 11 Mar 2015 06:16:13 -0400 Message-ID: <550015EB.2010601@suse.cz> Date: Wed, 11 Mar 2015 11:16:11 +0100 From: Michal Marek User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Mikko Rapeli CC: linux-kernel@vger.kernel.org, Andrew Morton , Javier Barrio Subject: Re: [PATCH 03/45] headers_install.sh: enhance error handling References: <1424127948-22484-1-git-send-email-mikko.rapeli@iki.fi> <1424127948-22484-4-git-send-email-mikko.rapeli@iki.fi> <54E33F7F.8020201@suse.cz> <20150310224448.GW12550@lakka.kapsi.fi> In-Reply-To: <20150310224448.GW12550@lakka.kapsi.fi> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2015-03-10 23:44, Mikko Rapeli wrote: > On Tue, Feb 17, 2015 at 02:17:51PM +0100, Michal Marek wrote: >> On 2015-02-17 00:05, Mikko Rapeli wrote: >>> Exit with error if using undefined variables or if any sub command fails >>> with error return value. unidef needs special handling since but this can >>> be done without the trap. Enables exaniming intermediate files if some >>> commands failed. >> >> The intermediate files are removed by your patch as well, aren't they? >> Actually, I don't see any change in behavior after your patch. > > Yes, if everything succeeded without errors, then intermediate files > are removed. But the files are left around if something fails They are not: + "$SRCDIR/$i" > "$OUTDIR/$FILE.sed" || \ + ( rm -f "$OUTDIR/$FILE.sed" ; exit 1 ) This removes "$OUTDIR/$FILE.sed" if the sed command files. Just like the trap command has been doing. Michal