From: Simon Marchi <simon.marchi@polymtl.ca>
To: Tom Tromey <tom@tromey.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA] Fix gdb snapshots
Date: Wed, 29 Nov 2017 17:06:00 -0000 [thread overview]
Message-ID: <8c132e8e9999cc5f1ddc2629d0e928fd@polymtl.ca> (raw)
In-Reply-To: <87zi756mw4.fsf@tromey.com>
On 2017-11-29 12:00, Tom Tromey wrote:
>>>>>> "Simon" == Simon Marchi <simon.marchi@polymtl.ca> 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
prev parent reply other threads:[~2017-11-29 17:06 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-29 16:32 Tom Tromey
2017-11-29 16:42 ` Simon Marchi
2017-11-29 17:00 ` Tom Tromey
2017-11-29 17:04 ` Tom Tromey
2017-11-29 17:27 ` Tom Tromey
2017-11-29 17:38 ` Simon Marchi
2017-11-29 18:53 ` Tom Tromey
2017-11-29 17:06 ` Simon Marchi [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8c132e8e9999cc5f1ddc2629d0e928fd@polymtl.ca \
--to=simon.marchi@polymtl.ca \
--cc=gdb-patches@sourceware.org \
--cc=tom@tromey.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox