Add support for less common compression schemes
This commit is contained in:
parent
7e1ee463ca
commit
98d03c74e1
1 changed files with 12 additions and 11 deletions
|
@ -190,18 +190,19 @@ def __call__(self, stage):
|
||||||
]
|
]
|
||||||
|
|
||||||
# Peek inside the compressed file.
|
# Peek inside the compressed file.
|
||||||
output = ''
|
if stage.archive_file.endswith('.zip'):
|
||||||
if stage.archive_file.endswith(('.tar', '.tar.gz', '.tar.bz2',
|
try:
|
||||||
'.tgz', '.tbz2')):
|
unzip = which('unzip')
|
||||||
tar = which('tar')
|
output = unzip('-l', stage.archive_file, output=str)
|
||||||
output = tar('--exclude=*/*/*', '-tf',
|
except:
|
||||||
|
output = ''
|
||||||
|
else:
|
||||||
|
try:
|
||||||
|
tar = which('tar')
|
||||||
|
output = tar('--exclude=*/*/*', '-tf',
|
||||||
stage.archive_file, output=str)
|
stage.archive_file, output=str)
|
||||||
elif stage.archive_file.endswith('.gz'):
|
except:
|
||||||
gunzip = which('gunzip')
|
output = ''
|
||||||
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)
|
|
||||||
lines = output.split('\n')
|
lines = output.split('\n')
|
||||||
|
|
||||||
# Determine the build system based on the files contained
|
# Determine the build system based on the files contained
|
||||||
|
|
Loading…
Reference in a new issue