From 87434fc38fafcd9ec49c2cdec2bbf7f25e46820c Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 13 Jul 2009 10:46:20 -0400 Subject: [PATCH] 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. --- Modules/UntarFile.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/Modules/UntarFile.cmake b/Modules/UntarFile.cmake index 9f8e4df6a..df33db8d3 100644 --- a/Modules/UntarFile.cmake +++ b/Modules/UntarFile.cmake @@ -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()