Fix utils.files.guess_archive_type to recognize the "tbz" extension as well

(also tidy up list of extensions)
This commit is contained in:
Jeffrey 'jf' Lim 2017-10-26 02:08:16 +08:00 committed by rallytime
parent bd5b9dd0aa
commit ba0eaae95e
No known key found for this signature in database
GPG key ID: E8F1A4B90D0DEA19

View file

@ -44,7 +44,9 @@ def guess_archive_type(name):
Guess an archive type (tar, zip, or rar) by its file extension
'''
name = name.lower()
for ending in ('tar', 'tar.gz', 'tar.bz2', 'tar.xz', 'tgz', 'tbz2', 'txz',
for ending in ('tar', 'tar.gz', 'tgz',
'tar.bz2', 'tbz2', 'tbz',
'tar.xz', 'txz',
'tar.lzma', 'tlz'):
if name.endswith('.' + ending):
return 'tar'