Fix extraction of LÖVE 11 package

This commit is contained in:
Antonin Décimo
2019-07-16 10:06:21 +02:00
parent 6b7ff6de7d
commit 4682ffef58
2 changed files with 24 additions and 14 deletions

View File

@@ -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")

View File

@@ -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