Message ID | 87r2sh6lmd.fsf@tromey.com |
---|---|
State | New, archived |
Headers |
Received: (qmail 110683 invoked by alias); 29 Nov 2017 17:27:42 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: <gdb-patches.sourceware.org> List-Unsubscribe: <mailto:gdb-patches-unsubscribe-##L=##H@sourceware.org> List-Subscribe: <mailto:gdb-patches-subscribe@sourceware.org> List-Archive: <http://sourceware.org/ml/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-help@sourceware.org>, <http://sourceware.org/ml/#faqs> Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 110673 invoked by uid 89); 29 Nov 2017 17:27:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KB_WAM_FROM_NAME_SINGLEWORD, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=haha, Hx-languages-length:1467, i X-HELO: gateway20.websitewelcome.com Received: from gateway20.websitewelcome.com (HELO gateway20.websitewelcome.com) (192.185.64.36) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 29 Nov 2017 17:27:40 +0000 Received: from cm15.websitewelcome.com (cm15.websitewelcome.com [100.42.49.9]) by gateway20.websitewelcome.com (Postfix) with ESMTP id 1B33D401003D3 for <gdb-patches@sourceware.org>; Wed, 29 Nov 2017 11:27:39 -0600 (CST) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id K695eodRR5b6TK695eyn7L; Wed, 29 Nov 2017 11:27:39 -0600 Received: from 71-218-90-63.hlrn.qwest.net ([71.218.90.63]:35046 helo=pokyo) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89) (envelope-from <tom@tromey.com>) id 1eK694-000eAb-TK; Wed, 29 Nov 2017 11:27:39 -0600 From: Tom Tromey <tom@tromey.com> To: Tom Tromey <tom@tromey.com> Cc: Simon Marchi <simon.marchi@polymtl.ca>, gdb-patches@sourceware.org Subject: Re: [RFA] Fix gdb snapshots References: <20171129163158.18968-1-tom@tromey.com> <8e2ede504e1aab0bc0cda57e10989bb2@polymtl.ca> <87zi756mw4.fsf@tromey.com> <87vaht6mov.fsf@tromey.com> Date: Wed, 29 Nov 2017 10:27:38 -0700 In-Reply-To: <87vaht6mov.fsf@tromey.com> (Tom Tromey's message of "Wed, 29 Nov 2017 10:04:32 -0700") Message-ID: <87r2sh6lmd.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-BWhitelist: no X-Source-L: No X-Exim-ID: 1eK694-000eAb-TK X-Source-Sender: 71-218-90-63.hlrn.qwest.net (pokyo) [71.218.90.63]:35046 X-Source-Auth: tom+tromey.com X-Email-Count: 6 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes |
Commit Message
Tom Tromey
Nov. 29, 2017, 5:27 p.m. UTC
>>>>> "Tom" == Tom Tromey <tom@tromey.com> writes:
Tom> - rmdir $$i/$(DEPDIR); \
Tom> + rm -rf $$i/$(DEPDIR) || true; \
Simon pointed out I failed to actually make the change.
Haha.
Here's try 3.
Tom
commit c24e0f6a00df51160118c5020d90a1aeb92eefc6
Author: Tom Tromey <tom@tromey.com>
Date: Wed Nov 29 09:27:40 2017 -0700
Fix gdb snapshots
Joel pointed out that gdb snapshots were broken by my Makefile patch
series. The bug is that rmdir in distclean was failing, because the
directory did not exist. This fixes the bug by only invoking rmdir when
the directory exists.
Tested using "src-release.sh gdb".
2017-11-29 Tom Tromey <tom@tromey.com>
* Makefile.in (distclean): Handle the case where rmdir fails.
Comments
On 2017-11-29 12:27, Tom Tromey wrote: >>>>>> "Tom" == Tom Tromey <tom@tromey.com> writes: > > Tom> - rmdir $$i/$(DEPDIR); \ > Tom> + rm -rf $$i/$(DEPDIR) || true; \ > > Simon pointed out I failed to actually make the change. > Haha. > > Here's try 3. > > Tom > > commit c24e0f6a00df51160118c5020d90a1aeb92eefc6 > Author: Tom Tromey <tom@tromey.com> > Date: Wed Nov 29 09:27:40 2017 -0700 > > Fix gdb snapshots > > Joel pointed out that gdb snapshots were broken by my Makefile > patch > series. The bug is that rmdir in distclean was failing, because > the > directory did not exist. This fixes the bug by only invoking rmdir > when > the directory exists. > > Tested using "src-release.sh gdb". > > 2017-11-29 Tom Tromey <tom@tromey.com> > > * Makefile.in (distclean): Handle the case where rmdir > fails. > > diff --git a/gdb/ChangeLog b/gdb/ChangeLog > index ebb969998c..dbea503d02 100644 > --- a/gdb/ChangeLog > +++ b/gdb/ChangeLog > @@ -1,3 +1,7 @@ > +2017-11-29 Tom Tromey <tom@tromey.com> > + > + * Makefile.in (distclean): Handle the case where rmdir fails. > + > 2017-11-27 Tom Tromey <tom@tromey.com> > > * Makefile.in (REMOTE_OBS): Remove. > diff --git a/gdb/Makefile.in b/gdb/Makefile.in > index 6e16bc6682..284559b030 100644 > --- a/gdb/Makefile.in > +++ b/gdb/Makefile.in > @@ -1995,7 +1995,7 @@ distclean: clean > rm -f Makefile > rm -rf $(DEPDIR) > for i in $(CONFIG_SRC_SUBDIR); do \ > - rmdir $$i/$(DEPDIR); \ > + if test -d $$i/$(DEPDIR); then rmdir $$i/$(DEPDIR); fi \ > done Since this is in distclean, we know that clean will have ran before, and thus .deps will be empty by now, is that right? In my original reply, I got confused and thought that the problem was that .deps was non-empty, when the problem was actually that it was not present (my bad for not reading carefully your log). If so, that version with the if looks good to me. My suggestion to do "[ -d ... ] && rmdir ..." would not have worked, because it would have returned a non-zero exit code and stopped the execution just like the current code. Thanks, Simon
Simon> Since this is in distclean, we know that clean will have ran before, Simon> and thus .deps will be empty by now, is that right? Yes. Simon> In my original Simon> reply, I got confused and thought that the problem was that .deps was Simon> non-empty, when the problem was actually that it was not present (my Simon> bad for not reading carefully your log). Thanks, but no big deal, everything is fine. Simon> If so, that version with the if looks good to me. I'm checking it in. Tom
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index ebb969998c..dbea503d02 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2017-11-29 Tom Tromey <tom@tromey.com> + + * Makefile.in (distclean): Handle the case where rmdir fails. + 2017-11-27 Tom Tromey <tom@tromey.com> * Makefile.in (REMOTE_OBS): Remove. diff --git a/gdb/Makefile.in b/gdb/Makefile.in index 6e16bc6682..284559b030 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -1995,7 +1995,7 @@ distclean: clean rm -f Makefile rm -rf $(DEPDIR) for i in $(CONFIG_SRC_SUBDIR); do \ - rmdir $$i/$(DEPDIR); \ + if test -d $$i/$(DEPDIR); then rmdir $$i/$(DEPDIR); fi \ done maintainer-clean: local-maintainer-clean do-maintainer-clean distclean