Add support for .tar files
This commit is contained in:
parent
179ed7cce6
commit
6acb830263
@ -142,7 +142,7 @@ def split_url_extension(path):
|
|||||||
|
|
||||||
def downloaded_file_extension(path):
|
def downloaded_file_extension(path):
|
||||||
"""This returns the type of archive a URL refers to. This is
|
"""This returns the type of archive a URL refers to. This is
|
||||||
sometimes confusing becasue of URLs like:
|
sometimes confusing because of URLs like:
|
||||||
|
|
||||||
(1) https://github.com/petdance/ack/tarball/1.93_02
|
(1) https://github.com/petdance/ack/tarball/1.93_02
|
||||||
|
|
||||||
|
@ -27,13 +27,12 @@
|
|||||||
from itertools import product
|
from itertools import product
|
||||||
from spack.util.executable import which
|
from spack.util.executable import which
|
||||||
|
|
||||||
# Supported archvie extensions.
|
# Supported archive extensions.
|
||||||
PRE_EXTS = ["tar"]
|
PRE_EXTS = ["tar"]
|
||||||
EXTS = ["gz", "bz2", "xz", "Z", "zip", "tgz"]
|
EXTS = ["gz", "bz2", "xz", "Z", "zip", "tgz"]
|
||||||
|
|
||||||
# Add EXTS last so that .tar.gz is matched *before* tar.gz
|
# Add PRE_EXTS and EXTS last so that .tar.gz is matched *before* .tar or .gz
|
||||||
ALLOWED_ARCHIVE_TYPES = [".".join(l) for l in product(PRE_EXTS, EXTS)] + EXTS
|
ALLOWED_ARCHIVE_TYPES = [".".join(l) for l in product(PRE_EXTS, EXTS)] + PRE_EXTS + EXTS
|
||||||
|
|
||||||
|
|
||||||
def allowed_archive(path):
|
def allowed_archive(path):
|
||||||
return any(path.endswith(t) for t in ALLOWED_ARCHIVE_TYPES)
|
return any(path.endswith(t) for t in ALLOWED_ARCHIVE_TYPES)
|
||||||
|
Loading…
Reference in New Issue
Block a user