From cc7bb37e1acebf58d2ac0b7c58554a8253d48652 Mon Sep 17 00:00:00 2001 From: Peter Melnichenko Date: Wed, 11 Jul 2018 13:48:26 +0300 Subject: [PATCH] Fix newly introduced error when installing Luarocks on win Archive names contain dots, don't remove too much when stripping extensions. --- hererocks.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hererocks.py b/hererocks.py index 42adca3..8bb5bce 100755 --- a/hererocks.py +++ b/hererocks.py @@ -419,8 +419,12 @@ def sha256_of_file(filename): return hashlib.sha256(contents).hexdigest() def strip_extensions(filename): - # Just handle .zip and .tar.gz. - return os.path.splitext(os.path.splitext(filename)[0])[0] + if filename.endswith(".zip"): + return filename[:-len(".zip")] + elif filename.endswith(".tar.gz"): + return filename[:-len(".tar.gz")] + else: + return filename class Program(object): def __init__(self, version):