This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
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, canSimon> 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
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |