summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-07-13 14:46:20 (GMT)
committerBrad King <brad.king@kitware.com>2009-07-13 14:46:20 (GMT)
commit87434fc38fafcd9ec49c2cdec2bbf7f25e46820c (patch)
treec9bd468e35657f76574bf301206bfdc71d728977
parent82c081ba356e735b89610f8d2fa9c0eabe66c08f (diff)
downloadCMake-87434fc38fafcd9ec49c2cdec2bbf7f25e46820c.zip
CMake-87434fc38fafcd9ec49c2cdec2bbf7f25e46820c.tar.gz
CMake-87434fc38fafcd9ec49c2cdec2bbf7f25e46820c.tar.bz2
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.
-rw-r--r--Modules/UntarFile.cmake1
1 files changed, 1 insertions, 0 deletions
diff --git a/Modules/UntarFile.cmake b/Modules/UntarFile.cmake
index 9f8e4df..df33db8 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()