summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam J. Stewart <ajstewart426@gmail.com>2016-06-06 15:31:04 -0500
committerAdam J. Stewart <ajstewart426@gmail.com>2016-06-20 12:24:45 -0500
commit98d03c74e114137537ee1865244c389d687aa5d6 (patch)
treee0be907a7b191f93465704e4c8c25351aa51a40b
parent7e1ee463ca677e3209c800a6c3b111dd8851b78d (diff)
downloadspack-98d03c74e114137537ee1865244c389d687aa5d6.tar.gz
spack-98d03c74e114137537ee1865244c389d687aa5d6.tar.bz2
spack-98d03c74e114137537ee1865244c389d687aa5d6.tar.xz
spack-98d03c74e114137537ee1865244c389d687aa5d6.zip
Add support for less common compression schemes
-rw-r--r--lib/spack/spack/cmd/create.py23
1 files changed, 12 insertions, 11 deletions
diff --git a/lib/spack/spack/cmd/create.py b/lib/spack/spack/cmd/create.py
index c976b98b17..dc927757fb 100644
--- a/lib/spack/spack/cmd/create.py
+++ b/lib/spack/spack/cmd/create.py
@@ -190,18 +190,19 @@ class ConfigureGuesser(object):
]
# Peek inside the compressed file.
- output = ''
- if stage.archive_file.endswith(('.tar', '.tar.gz', '.tar.bz2',
- '.tgz', '.tbz2')):
- tar = which('tar')
- output = tar('--exclude=*/*/*', '-tf',
+ if stage.archive_file.endswith('.zip'):
+ try:
+ unzip = which('unzip')
+ output = unzip('-l', stage.archive_file, output=str)
+ except:
+ output = ''
+ else:
+ try:
+ tar = which('tar')
+ output = tar('--exclude=*/*/*', '-tf',
stage.archive_file, output=str)
- elif stage.archive_file.endswith('.gz'):
- gunzip = which('gunzip')
- output = gunzip('-l', stage.archive_file, output=str)
- elif stage.archive_file.endswith('.zip'):
- unzip = which('unzip')
- output = unzip('-l', stage.archive_file, output=str)
+ except:
+ output = ''
lines = output.split('\n')
# Determine the build system based on the files contained