BUG: Teach UntarFile to delete dir on error

When tarball extraction fails we should still cleanup the temporary
extraction directory.  Otherwise the next attempt will create a new
directory and the first one will never be removed.
This commit is contained in:
Brad King 2009-07-13 10:46:20 -04:00
parent 82c081ba35
commit 87434fc38f
1 changed files with 1 additions and 0 deletions

View File

@ -59,6 +59,7 @@ execute_process(COMMAND ${CMAKE_COMMAND} -E tar ${args} ${filename}
RESULT_VARIABLE rv)
if(NOT rv EQUAL 0)
file(REMOVE_RECURSE "${ut_dir}")
message(FATAL_ERROR "error: untar of '${filename}' failed")
endif()