* On zsync delta failure, offer to retry OTA update with a full download
Fix#4429
* Bring the "this may take a while" popup back up before full DL
Don't rebuild the local tarball for a full dl, we're ignoring it anyway
;)
Co-Authored-By: NiLuJe <ninuje@gmail.com>
@ -175,9 +176,43 @@ function OTAManager:fetchAndProcessUpdate()
ifself.can_pretty_printthen
os.execute("./fbink -q -y -7 -pm ' ' ' '")
end
UIManager:show(ConfirmBox:new{
text=_("Error updating KOReader. Would you like to delete temporary files?"),
ok_callback=function()
UIManager:show(MultiConfirmBox:new{
text=_("Failed to update KOReader.\n\nYou can:\nCancel, keeping temporary files.\nRetry the update process with a full download.\nAbort and cleanup all temporary files."),
choice1_text=_("Retry"),
choice1_callback=function()
UIManager:show(InfoMessage:new{
text=_("Downloading may take several minutes…"),
timeout=3,
})
-- Clear the installed package, as well as the complete/incomplete update download
os.execute("rm "..self.installed_package)
os.execute("rm "..self.updated_package.."*")
-- And then relaunch zsync in full download mode...
UIManager:scheduleIn(1,function()
ifOTAManager:zsync(true)==0then
UIManager:show(InfoMessage:new{
text=_("KOReader will be updated on next restart."),
})
-- Make it clear that zsync is done
ifself.can_pretty_printthen
os.execute("./fbink -q -y -7 -pm ' ' ' '")
end
else
-- Make it clear that zsync is done
ifself.can_pretty_printthen
os.execute("./fbink -q -y -7 -pm ' ' ' '")
end
UIManager:show(ConfirmBox:new{
text=_("Error updating KOReader. Would you like to delete temporary files?"),
ok_callback=function()
os.execute("rm "..ota_dir.."ko*")
end,
})
end
end)
end,
choice2_text=_("Abort"),
choice2_callback=function()
os.execute("rm "..ota_dir.."ko*")
end,
})
@ -239,22 +274,34 @@ function OTAManager:_buildLocalPackage()
end
end
functionOTAManager:zsync()
if self:_buildLocalPackage()==0then
functionOTAManager:zsync(full_dl)
iffull_dl orself:_buildLocalPackage()==0then
localzsync_wrapper="zsync"
-- With visual feedback if supported...
ifself.can_pretty_printthen
zsync_wrapper="spinning_zsync"
end
returnos.execute(
("./%s -i '%s' -o '%s' -u '%s' '%s%s'"):format(
zsync_wrapper,
self.installed_package,
self.updated_package,
self:getOTAServer(),
ota_dir,
self:getZsyncFilename())
)
-- If that's a full-download fallback, drop the input tarball