From 98ea03443bea81188cfe55a885ac64c3ddd93b40 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 23 Jul 2014 15:52:51 -0400 Subject: [PATCH 1/2] ExternalProject: Recognize .tbz2 extension Also fix .bz2 extension to be .tar.bz2 since we only support compressed tarballs and not plain compressed files. Suggested-by: Nils Gladitz Suggested-by: Rolf Eike Beer --- Modules/ExternalProject.cmake | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake index 0d35cca1e..8274a53b2 100644 --- a/Modules/ExternalProject.cmake +++ b/Modules/ExternalProject.cmake @@ -737,7 +737,7 @@ endfunction() function(_ep_write_extractfile_script script_filename name filename directory) set(args "") - if(filename MATCHES "(\\.|=)(bz2|tar\\.gz|tgz|zip)$") + if(filename MATCHES "(\\.|=)(tar\\.bz2|tar\\.gz|tbz2|tgz|zip)$") set(args xfz) endif() @@ -746,7 +746,7 @@ function(_ep_write_extractfile_script script_filename name filename directory) endif() if(args STREQUAL "") - message(SEND_ERROR "error: do not know how to extract '${filename}' -- known types are .bz2, .tar, .tar.gz, .tgz and .zip") + message(SEND_ERROR "error: do not know how to extract '${filename}' -- known types are .tar, .tar.bz2, .tar.gz, .tbz2, .tgz and .zip") return() endif() @@ -1540,11 +1540,11 @@ function(_ep_add_download_command name) if("x${fname}" STREQUAL "x") string(REGEX MATCH "[^/\\?]*$" fname "${url}") endif() - if(NOT "${fname}" MATCHES "(\\.|=)(bz2|tar|tgz|tar\\.gz|zip)$") - string(REGEX MATCH "([^/\\?]+(\\.|=)(bz2|tar|tgz|tar\\.gz|zip))/.*$" match_result "${url}") + if(NOT "${fname}" MATCHES "(\\.|=)(tar|tar\\.bz2|tar\\.gz|tbz2|tgz|zip)$") + string(REGEX MATCH "([^/\\?]+(\\.|=)(tar|tar\\.bz2|tar\\.gz|tbz2|tgz|zip))/.*$" match_result "${url}") set(fname "${CMAKE_MATCH_1}") endif() - if(NOT "${fname}" MATCHES "(\\.|=)(bz2|tar|tgz|tar\\.gz|zip)$") + if(NOT "${fname}" MATCHES "(\\.|=)(tar|tar\\.bz2|tar\\.gz|tbz2|tgz|zip)$") message(FATAL_ERROR "Could not extract tarball filename from url:\n ${url}") endif() string(REPLACE ";" "-" fname "${fname}") From 56e6975ce98660c86690c5fb97e443402f4885a3 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 23 Jul 2014 15:54:04 -0400 Subject: [PATCH 2/2] ExternalProject: Recognize lzma-compressed files (#13515) Add .7z, .tar.xz, and .txz file extensions. Inspired-by: Joke de Buhr Inspired-by: David Cole --- Help/release/dev/ExternalProject-add-lzma.rst | 5 +++++ Modules/ExternalProject.cmake | 10 +++++----- 2 files changed, 10 insertions(+), 5 deletions(-) create mode 100644 Help/release/dev/ExternalProject-add-lzma.rst diff --git a/Help/release/dev/ExternalProject-add-lzma.rst b/Help/release/dev/ExternalProject-add-lzma.rst new file mode 100644 index 000000000..cb398efdd --- /dev/null +++ b/Help/release/dev/ExternalProject-add-lzma.rst @@ -0,0 +1,5 @@ +ExternalProject-add-lzma +------------------------ + +* The :module:`ExternalProject` module learned to support lzma-compressed + source tarballs with ``.7z``, ``.tar.xz``, and ``.txz`` extensions. diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake index 8274a53b2..dbce9f4ca 100644 --- a/Modules/ExternalProject.cmake +++ b/Modules/ExternalProject.cmake @@ -737,7 +737,7 @@ endfunction() function(_ep_write_extractfile_script script_filename name filename directory) set(args "") - if(filename MATCHES "(\\.|=)(tar\\.bz2|tar\\.gz|tbz2|tgz|zip)$") + if(filename MATCHES "(\\.|=)(7z|tar\\.bz2|tar\\.gz|tar\\.xz|tbz2|tgz|txz|zip)$") set(args xfz) endif() @@ -746,7 +746,7 @@ function(_ep_write_extractfile_script script_filename name filename directory) endif() if(args STREQUAL "") - message(SEND_ERROR "error: do not know how to extract '${filename}' -- known types are .tar, .tar.bz2, .tar.gz, .tbz2, .tgz and .zip") + message(SEND_ERROR "error: do not know how to extract '${filename}' -- known types are .7z, .tar, .tar.bz2, .tar.gz, .tar.xz, .tbz2, .tgz, .txz and .zip") return() endif() @@ -1540,11 +1540,11 @@ function(_ep_add_download_command name) if("x${fname}" STREQUAL "x") string(REGEX MATCH "[^/\\?]*$" fname "${url}") endif() - if(NOT "${fname}" MATCHES "(\\.|=)(tar|tar\\.bz2|tar\\.gz|tbz2|tgz|zip)$") - string(REGEX MATCH "([^/\\?]+(\\.|=)(tar|tar\\.bz2|tar\\.gz|tbz2|tgz|zip))/.*$" match_result "${url}") + if(NOT "${fname}" MATCHES "(\\.|=)(7z|tar|tar\\.bz2|tar\\.gz|tar\\.xz|tbz2|tgz|txz|zip)$") + string(REGEX MATCH "([^/\\?]+(\\.|=)(7z|tar|tar\\.bz2|tar\\.gz|tar\\.xz|tbz2|tgz|txz|zip))/.*$" match_result "${url}") set(fname "${CMAKE_MATCH_1}") endif() - if(NOT "${fname}" MATCHES "(\\.|=)(tar|tar\\.bz2|tar\\.gz|tbz2|tgz|zip)$") + if(NOT "${fname}" MATCHES "(\\.|=)(7z|tar|tar\\.bz2|tar\\.gz|tar\\.xz|tbz2|tgz|txz|zip)$") message(FATAL_ERROR "Could not extract tarball filename from url:\n ${url}") endif() string(REPLACE ";" "-" fname "${fname}")