On 5/14/21 5:23 PM, Simon Marchi wrote: > > > On 2021-05-14 11:03 a.m., Bernd Edlinger wrote: >> On 5/14/21 3:26 PM, Simon Marchi wrote: >>> On 2021-05-14 9:20 a.m., Bernd Edlinger wrote: >>>> Hi, >>>> >>>> I'd like to cleanup some files/directories which >>>> remain after the gdb testsute runs. >>>> >>>> I want to avoid using "rm -rf ..." since that can be dangerous. >>>> Therefore I remove the *.gdb-index files, if any, and use >>>> rmdir instead. I am not sure if there is a better way, >>>> instead of using "remote_exec host sh -c" to do the globbing. >>>> >>>> Tested on x86_64-pc-linux-gnu. >>>> Is it OK for trunk? >>>> >>>> >>>> gdb/testsuite: >>>> 2021-05-14 Bernd Edlinger >>>> >>>> * gdb.base/index-cache.exp: Cleanup $cache_dir/*.gdb-index and >>>> remove the directory. >>>> * gdb.dwarf2/per-bfd-sharing.exp: Likewise. >>>> >>> >>> LGTM, but I have one question: if the rm or rmdir ever fails (because >>> there are additional files to delete, for example), would we know about >>> it or would it silently fail? I think it would be nice if the error >>> was noisy so we could fix it. >>> >> >> Ah Yes, good point, that would be as silent as before. >> >> So, how about this new version? > > LGTM, but while at it let's check the return value of both commands. > Yeah Okay. I think then I should also remove the -f switch from the rm command, so it has something to complain about when there is nothing to there to delete, since there should always be one index file at the end of the tests which have just completed. So like this? Thanks Bernd.