Skip to content

Commit e45f664

Browse files
committed
update the updator to update the hash
1 parent 911aded commit e45f664

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/UpdateCheck.lua

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ end
122122
localSource = localSource:gsub("{branch}", localBranch)
123123

124124
-- Download and process remote manifest
125-
local remoteVer
125+
local remoteVer, remoteHash
126126
local remoteFiles = { }
127127
local remoteSources = { }
128128
local remoteManText, errMsg = downloadFileText(localSource, "manifest.xml")
@@ -136,6 +136,7 @@ if remoteManXML and remoteManXML[1].elem == "PoBVersion" then
136136
if type(node) == "table" then
137137
if node.elem == "Version" then
138138
remoteVer = node.attrib.number
139+
remoteHash = node.attrib.hash
139140
elseif node.elem == "Source" then
140141
if not remoteSources[node.attrib.part] then
141142
remoteSources[node.attrib.part] = { }
@@ -155,7 +156,7 @@ if remoteManXML and remoteManXML[1].elem == "PoBVersion" then
155156
end
156157
end
157158
end
158-
if not remoteVer or not next(remoteSources) or not next(remoteFiles) then
159+
if not remoteVer or not remoteHash or not next(remoteSources) or not next(remoteFiles) then
159160
ConPrintf("Update check failed: invalid remote manifest")
160161
return nil, "Invalid remote manifest"
161162
end
@@ -264,7 +265,7 @@ end
264265

265266
-- Create new manifest
266267
localManXML = { elem = "PoBVersion" }
267-
table.insert(localManXML, { elem = "Version", attrib = { number = remoteVer, platform = localPlatform, branch = localBranch } })
268+
table.insert(localManXML, { elem = "Version", attrib = { number = remoteVer, hash = remoteHash, platform = localPlatform, branch = localBranch } })
268269
for part, platforms in pairs(remoteSources) do
269270
for platform, url in pairs(platforms) do
270271
table.insert(localManXML, { elem = "Source", attrib = { part = part, platform = platform ~= "any" and platform, url = url } })

0 commit comments

Comments
 (0)