On Mon, Nov 19, 2018 at 08:27:56AM -0600, Eric Blake wrote: > On 11/19/18 5:04 AM, Max Reitz wrote: > > > > > > +tls_dir="${TEST_DIR}/tls" > > > > > + > > > > > +function tls_x509_cleanup() > > > > > +{ > > > > > + rm -f ${tls_dir}/*.pem > > > > > + rm -f ${tls_dir}/*/*.pem > > > > > + rmdir ${tls_dir}/* > > > > > + rmdir ${tls_dir} > > > > > > > > Why not just: > > > > rm -rf $tls_dir > > > > > > Yeah, I guess we could do that for simplicity > > > > > > > Also, the quoting is a bit inconsistent. if ${TEST_DIR} can contain > > > > spaces, > > > > then all uses of ${tls_dir} need to be in "". > > > > > > Hmm, yes. > > > > Which by the way is a very good reason *not* to blindly use "rm -r". > > If we ever revive Jeff Cody's patches to let each test run with its own > temporary directory, then we don't need this function at all. With that in > place, you either run the testsuite in debug mode (all temporary files > preserved) or in normal mode (./check itself does rm -rf on the temporary > directory).
That would be very nice - i'm often just commenting out the rm lines to preserve temp files. Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|