From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26377 invoked by alias); 29 Nov 2017 17:06:25 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 26354 invoked by uid 89); 29 Nov 2017 17:06:24 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,KB_WAM_FROM_NAME_SINGLEWORD,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=i X-HELO: smtp.polymtl.ca Received: from smtp.polymtl.ca (HELO smtp.polymtl.ca) (132.207.4.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 29 Nov 2017 17:06:23 +0000 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id vATH5qNA014591 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 29 Nov 2017 12:06:04 -0500 Received: by simark.ca (Postfix, from userid 112) id 715A71E585; Wed, 29 Nov 2017 12:05:52 -0500 (EST) Received: from simark.ca (localhost [127.0.0.1]) by simark.ca (Postfix) with ESMTP id 359AC1E51E; Wed, 29 Nov 2017 12:05:42 -0500 (EST) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 29 Nov 2017 17:06:00 -0000 From: Simon Marchi To: Tom Tromey Cc: gdb-patches@sourceware.org Subject: Re: [RFA] Fix gdb snapshots In-Reply-To: <87zi756mw4.fsf@tromey.com> References: <20171129163158.18968-1-tom@tromey.com> <8e2ede504e1aab0bc0cda57e10989bb2@polymtl.ca> <87zi756mw4.fsf@tromey.com> Message-ID: <8c132e8e9999cc5f1ddc2629d0e928fd@polymtl.ca> X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.3.2 X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Wed, 29 Nov 2017 17:05:55 +0000 X-IsSubscribed: yes X-SW-Source: 2017-11/txt/msg00780.txt.bz2 On 2017-11-29 12:00, Tom Tromey wrote: >>>>>> "Simon" == Simon Marchi writes: > > Simon> As always, I am really not comfortable with using rm -rf in > scripts. > > You'll be disappointed by the current Makefile then :) > > Simon> Since we know that the .deps directories will only contain > files, can > Simon> we do something like this instead (not tested)? > Simon> rm -f $$i/$(DEPDIR)/* > Simon> rmdir $$i/$(DEPDIR) > > The issue is that this rmdir will fail because, in this situation, the > directory does not exist at all. > > Perhaps rmdir||true will be more to your liking. It's too bad rmdir does not have a -f switch like rm... To avoid printing an error message (No such file or directory) when the directory does not exist, you could do: [ -d $$i/$(DEPDIR) ] && rmdir $$i/$(DEPDIR) or test -d $$i/$(DEPDIR) && $$i/$(DEPDIR) Simon