mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
don't need to rebuild ota installed package if it's detected
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
local InfoMessage = require("ui/widget/infomessage")
|
||||
local ConfirmBox = require("ui/widget/confirmbox")
|
||||
local NetworkMgr = require("ui/networkmgr")
|
||||
local lfs = require("libs/libkoreader-lfs")
|
||||
local UIManager = require("ui/uimanager")
|
||||
local Device = require("ui/device")
|
||||
local DEBUG = require("dbg")
|
||||
@@ -128,6 +129,11 @@ function OTAManager:fetchAndProcessUpdate()
|
||||
end
|
||||
|
||||
function OTAManager:_buildLocalPackage()
|
||||
-- TODO: validate the installed package?
|
||||
local installed_package = lfs.currentdir() .. "/" .. self.installed_package
|
||||
if lfs.attributes(installed_package, "mode") == "file" then
|
||||
return 0
|
||||
end
|
||||
return os.execute(string.format(
|
||||
"./tar cvf %s -C .. -T %s --no-recursion",
|
||||
self.installed_package, self.package_indexfile))
|
||||
|
||||
@@ -83,6 +83,7 @@ cd "${KOREADER_DIR}"
|
||||
|
||||
# Handle pending OTA update
|
||||
NEWUPDATE="${KOREADER_DIR}/ota/koreader.updated.tar"
|
||||
INSTALLED="${KOREADER_DIR}/ota/koreader.installed.tar"
|
||||
if [ -f "${NEWUPDATE}" ] ; then
|
||||
logmsg "Updating koreader . . ."
|
||||
# Look for our own GNU tar build to do a fancy progress tracking...
|
||||
@@ -98,7 +99,7 @@ if [ -f "${NEWUPDATE}" ] ; then
|
||||
fi
|
||||
# Cleanup behind us...
|
||||
if [ $? -eq 0 ] ; then
|
||||
rm "${NEWUPDATE}"
|
||||
mv "${NEWUPDATE}" "${INSTALLED}"
|
||||
logmsg "Update sucessful :)"
|
||||
eips_print_bottom_centered "Update successful :)" 1
|
||||
else
|
||||
|
||||
@@ -5,10 +5,11 @@ export LC_ALL="en_US.UTF-8"
|
||||
KOREADER_DIR=/mnt/onboard/.kobo/koreader
|
||||
|
||||
# update to new version from OTA directory
|
||||
NEWUPDATE=${KOREADER_DIR}/ota/koreader.updated.tar
|
||||
NEWUPDATE="${KOREADER_DIR}/ota/koreader.updated.tar"
|
||||
INSTALLED="${KOREADER_DIR}/ota/koreader.installed.tar"
|
||||
if [ -f $NEWUPDATE ]; then
|
||||
# TODO: any graphic indication for the updating progress?
|
||||
cd /mnt/onboard/.kobo && tar xf $NEWUPDATE && rm $NEWUPDATE
|
||||
cd /mnt/onboard/.kobo && tar xf $NEWUPDATE && mv $NEWUPDATE $INSTALLED
|
||||
fi
|
||||
|
||||
# we're always starting from our working directory
|
||||
|
||||
Reference in New Issue
Block a user