From 4682ffef58ef76e6f6ea4d6573c520e5694f539f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonin=20D=C3=A9cimo?= Date: Tue, 16 Jul 2019 10:06:21 +0200 Subject: [PATCH] =?UTF-8?q?Fix=20extraction=20of=20L=C3=96VE=2011=20packag?= =?UTF-8?q?e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/scripts/macosx.lua | 2 +- src/scripts/windows.lua | 36 +++++++++++++++++++++++------------- 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/src/scripts/macosx.lua b/src/scripts/macosx.lua index a2997e9..89e755c 100644 --- a/src/scripts/macosx.lua +++ b/src/scripts/macosx.lua @@ -28,7 +28,7 @@ function s.script(project) local prefix = "love-"..tostring(project.loveVersion).."-macos" local bin - if project.loveVersion >= ver'11.0.0' then + if project.loveVersion >= ver'11.0' then bin = prefix..".zip" elseif project.loveVersion == ver'0.10.0' then utils.io.err("MacOS X: No LÖVE 0.10.0 binary available.\n") diff --git a/src/scripts/windows.lua b/src/scripts/windows.lua index 819ccb5..36db995 100644 --- a/src/scripts/windows.lua +++ b/src/scripts/windows.lua @@ -12,16 +12,17 @@ local s = {} local function release(script, project, arch) - local prefix = "love-"..tostring(project.loveVersion).."-win" - local dir, bin - if project.loveVersion.major == 11 then - bin = prefix..arch..".zip" - prefix = "love-"..tostring(project.loveVersion)..".0-win" - dir = prefix..arch.."/" - elseif project.loveVersion >= ver'0.9.0' then + local prefix, dir, bin + if project.loveVersion >= ver'11.1' then + prefix = "love-"..tostring(project.loveVersion) + dir = prefix..".0-win"..arch.."/" + prefix = prefix.."-win" bin = prefix..arch..".zip" - dir = prefix..arch.."/" - else + elseif project.loveVersion == ver'11.0' then + prefix = "love-"..tostring(project.loveVersion)..".0-win" + dir, bin = prefix..arch.."/", prefix..arch..".zip" + elseif project.loveVersion <= ver'0.8.0' then + prefix = "love-"..tostring(project.loveVersion).."-win" if arch == 32 then bin = prefix.."-x86.zip" dir = prefix.."-x86/" @@ -29,6 +30,9 @@ local function release(script, project, arch) bin = prefix.."-x64.zip" dir = prefix.."-x64/" end + else + prefix = "love-"..tostring(project.loveVersion).."-win" + dir, bin = prefix..arch.."/", prefix..arch..".zip" end local url = "https://bitbucket.org/rude/love/downloads/"..bin local cache = utils.cache.."/"..bin @@ -45,10 +49,17 @@ local function release(script, project, arch) gameHandle:close() -- local ar = assert(zip.open(bin, zip.OR(zip.CHECKCONS))) - local ar = zip.open(bin) + local msg + local ar, exeHandle, stat, exe + ar, msg = zip.open(bin) + if not ar then assert(ar, bin..": "..msg) end - local exeHandle = assert(ar:open(dir.."love.exe")) - local exe = assert(exeHandle:read(assert(ar:stat(dir.."love.exe")).size)) + exeHandle, msg = ar:open(dir.."love.exe") + if not exeHandle then assert(exeHandle, dir.."love.exe: "..msg) end + stat, msg = ar:stat(dir.."love.exe") + if not stat then assert(stat, dir.."love.exe: "..msg) end + exe, msg = exeHandle:read(stat.size) + if not exe then assert(exe, stat.size..": "..msg) end exeHandle:close() ar:add(dir..project.package..".exe", "string", exe..game) @@ -56,7 +67,6 @@ local function release(script, project, arch) ar:delete(dir.."readme.txt") ar:delete(dir.."changes.txt") - local stat for i = 1, #ar do stat = ar:stat(i) if stat then