Minor changes to manifest format

This commit is contained in:
Openarl
2016-05-18 21:59:04 +10:00
parent d482733c46
commit fb8f8342b0
8 changed files with 36 additions and 31 deletions

View File

@@ -10,12 +10,14 @@ local basicFiles = { "Launch.lua", "Update.lua" }
local xml = require("xml")
local curl = require("lcurl")
local localSource
local localBranch, localSource
local localManXML = xml.LoadXMLFile("manifest.xml")
if localManXML and localManXML[1].elem == "PoBVersion" then
for _, node in ipairs(localManXML[1]) do
if type(node) == "table" then
if node.elem == "Source" then
if node.elem == "Version" then
localBranch = node.attrib.branch
elseif node.elem == "Source" then
if node.attrib.part == "program" then
localSource = node.attrib.url
end
@@ -23,10 +25,11 @@ if localManXML and localManXML[1].elem == "PoBVersion" then
end
end
end
if not localSource then
if not localBranch or not localSource then
Exit("Install failed. (Missing or invalid manifest)")
return
end
localSource = localSource:gsub("{branch}", localBranch)
for _, name in pairs(basicFiles) do
local outFile = io.open(name, "wb")
local easy = curl.easy()