From 9a20fb5836860e25a687c5f4ec5bc56773c1d2ab Mon Sep 17 00:00:00 2001 From: NiLuJe Date: Tue, 4 Feb 2020 03:14:23 +0100 Subject: [PATCH] Switch to zsync2 (#5810) * Switch to zsync2 Requires https://github.com/koreader/koreader-base/pull/1036 * Simplify FBInk syntax The weird-ass workarounds for -s's subopts handling are no longer needed w/ FBInk >= 1.21.0 * Update base * Re-enable HW dithering on Kindle (https://github.com/koreader/koreader-base/pull/1034) * Update SQLite to 3.31.1 (https://github.com/koreader/koreader-base/pull/1035) * reMarkable port (https://github.com/koreader/koreader-base/pull/1023) * zsync2 (https://github.com/koreader/koreader-base/pull/1036) * zsync2 means we can finally have nice things (OpenStack backed storage) * We also no longer need that insane workaround on ARM * And comment out @chrox's mirror, which appears to be down. * Warn that a malformed URL will horribly blow up in fun and interesting ways --- base | 2 +- frontend/ui/otamanager.lua | 21 +++++++++------------ platform/android/llapp_main.lua | 1 - platform/common/spinning_zsync | 4 ++-- platform/kobo/koreader.sh | 2 +- 5 files changed, 13 insertions(+), 17 deletions(-) diff --git a/base b/base index 26bb2a880..c258c33ab 160000 --- a/base +++ b/base @@ -1 +1 @@ -Subproject commit 26bb2a880350a67768da68bbc2872b185405e474 +Subproject commit c258c33abc45d42bfd232bb55fec05be15ac068d diff --git a/frontend/ui/otamanager.lua b/frontend/ui/otamanager.lua index 79d70a5e9..035d7e0ad 100644 --- a/frontend/ui/otamanager.lua +++ b/frontend/ui/otamanager.lua @@ -19,20 +19,17 @@ local T = require("ffi/util").template local ota_dir = DataStorage:getDataDir() .. "/ota/" local OTAManager = { + -- NOTE: Each URL *MUST* end with a / ota_servers = { - "http://ota.koreader.rocks:80/", - "http://vislab.bjmu.edu.cn:80/apps/koreader/ota/", + "http://ota.koreader.rocks/", --[[ - -- NOTE: Because we can't have nice things, - -- the HTTP frontend of these OpenStack storage containers doesn't actually properly support - -- HTTP/1.1 Range requests when multiple byte ranges are requested: they return bogus data when doing so, - -- which confuses zsync, causing it to retry indefinitely instead of aborting... - -- c.f., https://github.com/koreader/koreader-base/pull/699 - "http://koreader-fr.ak-team.com:80/", - "http://koreader-pl.ak-team.com:80/", - "http://koreader-na.ak-team.com:80/", + -- NOTE: Seems down? Ping @chrox ;). + "http://vislab.bjmu.edu.cn/apps/koreader/ota/", --]] - "http://koreader.ak-team.com:80/", + "http://koreader-fr.ak-team.com/", + "http://koreader-pl.ak-team.com/", + "http://koreader-na.ak-team.com/", + "http://koreader.ak-team.com/", }, ota_channels = { "stable", @@ -395,7 +392,7 @@ end function OTAManager:zsync(full_dl) if full_dl or self:_buildLocalPackage() == 0 then - local zsync_wrapper = "zsync" + local zsync_wrapper = "zsync2" -- With visual feedback if supported... if self.can_pretty_print then zsync_wrapper = "spinning_zsync" diff --git a/platform/android/llapp_main.lua b/platform/android/llapp_main.lua index b6cecedfb..8ad60ae3e 100644 --- a/platform/android/llapp_main.lua +++ b/platform/android/llapp_main.lua @@ -23,7 +23,6 @@ pcall(dofile, path.."/koreader/patch.lua") -- Cf. . android.execute("chmod", "755", "./sdcv") android.execute("chmod", "755", "./tar") -android.execute("chmod", "755", "./zsync") -- set TESSDATA_PREFIX env var C.setenv("TESSDATA_PREFIX", path.."/koreader/data", 1) diff --git a/platform/common/spinning_zsync b/platform/common/spinning_zsync index b35f9e210..756c08edb 100755 --- a/platform/common/spinning_zsync +++ b/platform/common/spinning_zsync @@ -38,8 +38,8 @@ fi done ) & -# Launch zsync, and remember its exit code... -./zsync "$@" +# Launch zsync2, and remember its exit code... +./zsync2 "$@" rc=$? # Kill the spinner subshell now that we're done diff --git a/platform/kobo/koreader.sh b/platform/kobo/koreader.sh index b58d90a76..ced0fb976 100755 --- a/platform/kobo/koreader.sh +++ b/platform/kobo/koreader.sh @@ -257,7 +257,7 @@ while [ ${RETURN_VALUE} -ne 0 ]; do # The idea for the margins being to leave enough room for an fbink -Z bar, small horizontal margins, and a font size based on what 6pt looked like @ 265dpi ./fbink -q -b -O -t regular=./fonts/droid/DroidSansMono.ttf,top=$((viewHeight / 2 + FONTH * 2 + FONTH / 2)),left=$((viewWidth / 60)),right=$((viewWidth / 60)),px=$((viewHeight / 64)) "${crashLog}" # So far, we hadn't triggered an actual screen refresh, do that now, to make sure everything is bundled in a single flashing refresh. - ./fbink -q -f -s top=0,left=0 + ./fbink -q -f -s # Cue a lemming's faceplant sound effect! {