Fix newly introduced error when installing Luarocks on win
Archive names contain dots, don't remove too much when stripping extensions.
This commit is contained in:
parent
095dcc9b4a
commit
cc7bb37e1a
@ -419,8 +419,12 @@ def sha256_of_file(filename):
|
|||||||
return hashlib.sha256(contents).hexdigest()
|
return hashlib.sha256(contents).hexdigest()
|
||||||
|
|
||||||
def strip_extensions(filename):
|
def strip_extensions(filename):
|
||||||
# Just handle .zip and .tar.gz.
|
if filename.endswith(".zip"):
|
||||||
return os.path.splitext(os.path.splitext(filename)[0])[0]
|
return filename[:-len(".zip")]
|
||||||
|
elif filename.endswith(".tar.gz"):
|
||||||
|
return filename[:-len(".tar.gz")]
|
||||||
|
else:
|
||||||
|
return filename
|
||||||
|
|
||||||
class Program(object):
|
class Program(object):
|
||||||
def __init__(self, version):
|
def __init__(self, version):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user