mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
* 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
50 lines
1.7 KiB
Bash
Executable File
50 lines
1.7 KiB
Bash
Executable File
#!/bin/sh
|
||
|
||
# Figure out whether that's a delta or a full download given the number of arguments passed...
|
||
if [ $# -lt 7 ]; then
|
||
ZSYNC_MESSAGE="Downloading update data"
|
||
else
|
||
ZSYNC_MESSAGE="Computing zsync delta"
|
||
fi
|
||
|
||
# Small zsync wrapper so we can get a pretty spinner while it works...
|
||
./fbink -q -y -7 -pmh "${ZSYNC_MESSAGE} !"
|
||
# Clear any potential leftover from the local OTA tarball creation.
|
||
./fbink -q -y -6 -pm ' '
|
||
|
||
# Spin in the background while we work ;).
|
||
(
|
||
# See https://stackoverflow.com/questions/2685435 for inspiration
|
||
# as well as https://www.npmjs.com/package/cli-spinners
|
||
# & https://github.com/swelljoe/spinner
|
||
# http://www.fileformat.info/info/unicode/block/block_elements/list.htm
|
||
##
|
||
# Simple bars, they look better when a bit smoother, with a snappier interval (~250ms)
|
||
#SPINNER="<22> ▁ ▂ ▃ ▄ ▅ ▆ ▇ █ ▇ ▆ ▅ ▄ ▃ ▂ ▁"
|
||
#SPINNER="<22> ▏ ▎ ▍ ▌ ▋ ▊ ▉ █ ▉ ▊ ▋ ▌ ▍ ▎ ▏"
|
||
# Spinning blocks
|
||
SPINNER="▖ ▘ ▝ ▗"
|
||
#SPINNER="▜ ▟ ▙ ▛"
|
||
# Snaking blocks
|
||
#SPINNER="▌ ▀ ▐ ▄"
|
||
#SPINNER="▌ ▛ ▀ ▜ ▐ ▟ ▄ ▙"
|
||
while :; do
|
||
for spin in ${SPINNER}; do
|
||
usleep 500000 2>/dev/null || sleep 0.5
|
||
# NOTE: Throw stderr to the void because I'm cheating w/ U+FFFD for a blank character,
|
||
# which FBInk replaces by a blank, but not before shouting at us on stderr ;).
|
||
./fbink -q -y -7 -pmh "${ZSYNC_MESSAGE} ${spin}" 2>/dev/null
|
||
done
|
||
done
|
||
) &
|
||
|
||
# Launch zsync2, and remember its exit code...
|
||
./zsync2 "$@"
|
||
rc=$?
|
||
|
||
# Kill the spinner subshell now that we're done
|
||
kill -15 $!
|
||
|
||
# And return with zsync's exit code, not kill's ;).
|
||
exit ${rc}
|