From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 76738 invoked by alias); 29 Nov 2017 16:42:03 -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 76629 invoked by uid 89); 29 Nov 2017 16:42:02 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.8 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KB_WAM_FROM_NAME_SINGLEWORD,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham 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 16:42:00 +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 vATGfqSY032560 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 29 Nov 2017 11:41:57 -0500 Received: by simark.ca (Postfix, from userid 112) id AEFB31E585; Wed, 29 Nov 2017 11:41:52 -0500 (EST) Received: from simark.ca (localhost [127.0.0.1]) by simark.ca (Postfix) with ESMTP id 62C581E02D; Wed, 29 Nov 2017 11:41: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 16:42:00 -0000 From: Simon Marchi To: Tom Tromey Cc: gdb-patches@sourceware.org Subject: Re: [RFA] Fix gdb snapshots In-Reply-To: <20171129163158.18968-1-tom@tromey.com> References: <20171129163158.18968-1-tom@tromey.com> Message-ID: <8e2ede504e1aab0bc0cda57e10989bb2@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 16:41:52 +0000 X-IsSubscribed: yes X-SW-Source: 2017-11/txt/msg00777.txt.bz2 On 2017-11-29 11:31, Tom Tromey wrote: > Joel pointed out that gdb snapshots were broken by my Makefile patch > series. The bug is that rmdir in distclean was failing, because the > directories in question did not exist. The simplest fix was to just > use > "rm -rf", which won't fail if the directory is missing. > > Tested using "src-release.sh gdb". > > 2017-11-29 Tom Tromey > > * Makefile.in (distclean): Use "rm -rf", not "rmdir". > --- > gdb/ChangeLog | 4 ++++ > gdb/Makefile.in | 4 +++- > 2 files changed, 7 insertions(+), 1 deletion(-) > > diff --git a/gdb/ChangeLog b/gdb/ChangeLog > index ebb969998c..7532016499 100644 > --- a/gdb/ChangeLog > +++ b/gdb/ChangeLog > @@ -1,3 +1,7 @@ > +2017-11-29 Tom Tromey > + > + * Makefile.in (distclean): Use "rm -rf", not "rmdir". > + > 2017-11-27 Tom Tromey > > * Makefile.in (REMOTE_OBS): Remove. > diff --git a/gdb/Makefile.in b/gdb/Makefile.in > index 6e16bc6682..39f90bad9f 100644 > --- a/gdb/Makefile.in > +++ b/gdb/Makefile.in > @@ -1995,7 +1995,9 @@ distclean: clean > rm -f Makefile > rm -rf $(DEPDIR) > for i in $(CONFIG_SRC_SUBDIR); do \ > - rmdir $$i/$(DEPDIR); \ > + # Use rm -rf, not rmdir, to avoid errors when the \ > + # directory does not exist. \ > + rm -rf $$i/$(DEPDIR); \ > done > > maintainer-clean: local-maintainer-clean do-maintainer-clean distclean As always, I am really not comfortable with using rm -rf in scripts. Ref: https://github.com/MrMEEE/bumblebee-Old-and-abbandoned/issues/123 Since we know that the .deps directories will only contain files, can we do something like this instead (not tested)? rm -f $$i/$(DEPDIR)/* rmdir $$i/$(DEPDIR) Simon