mirror of https://github.com/koreader/koreader
Enhanced visual feedback around tar & zsync! (#4194)
* Move Kindle scripts to FBInk * Proper progress bars around tar invocations * Spinner during zsync processingpull/4203/head
parent
850be52177
commit
ababbd7aad
@ -1 +1 @@
|
|||||||
Subproject commit 22d94e931c9f272eca96fbaab389afca6aaff3dc
|
Subproject commit f436894521f53a1440f40c35315da14d4b2a2894
|
@ -1,44 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# KOReader's working directory
|
|
||||||
KOREADER_DIR="/mnt/us/koreader"
|
|
||||||
|
|
||||||
# We do NOT want to sleep during eips calls!
|
|
||||||
export EIPS_NO_SLEEP="true"
|
|
||||||
|
|
||||||
# Load our helper functions...
|
|
||||||
if [ -f "${KOREADER_DIR}/libkohelper.sh" ]; then
|
|
||||||
# shellcheck source=/dev/null
|
|
||||||
. "${KOREADER_DIR}/libkohelper.sh"
|
|
||||||
else
|
|
||||||
echo "Can't source helper functions, aborting!"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
## First arg is the checkpoint number, and we get one every 200 checkpoints.
|
|
||||||
CHECKPOINT_NUM="${1}"
|
|
||||||
CHECKPOINT_GRANULARITY="200"
|
|
||||||
|
|
||||||
# Use that to build a progress bar
|
|
||||||
PROGRESS_AMOUNT="$((CHECKPOINT_NUM / CHECKPOINT_GRANULARITY))"
|
|
||||||
|
|
||||||
# Which text do we want to use?
|
|
||||||
case "${2}" in
|
|
||||||
"create")
|
|
||||||
PROGRESS_BASE_STRING="Preparing local OTA package"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
PROGRESS_BASE_STRING="Updating KOReader"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# And start drawing the progress bar...
|
|
||||||
PROGRESS_STRING=""
|
|
||||||
for _ in $(seq 1 ${PROGRESS_AMOUNT}); do
|
|
||||||
# Fill the progress bar...
|
|
||||||
PROGRESS_STRING="${PROGRESS_STRING}."
|
|
||||||
done
|
|
||||||
|
|
||||||
# Print our progress :)
|
|
||||||
eips_print_bottom_centered "${PROGRESS_BASE_STRING}" 3
|
|
||||||
eips_print_bottom_centered "${PROGRESS_STRING}" 2
|
|
@ -1,27 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# KOReader's working directory
|
|
||||||
KOREADER_DIR="/mnt/us/koreader"
|
|
||||||
|
|
||||||
# We do NOT want to sleep during eips calls!
|
|
||||||
export EIPS_NO_SLEEP="true"
|
|
||||||
|
|
||||||
# Load our helper functions...
|
|
||||||
if [ -f "${KOREADER_DIR}/libkohelper.sh" ]; then
|
|
||||||
# shellcheck source=/dev/null
|
|
||||||
. "${KOREADER_DIR}/libkohelper.sh"
|
|
||||||
else
|
|
||||||
echo "Can't source helper functions, aborting!"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# What are we printing?
|
|
||||||
case "${1}" in
|
|
||||||
"clear")
|
|
||||||
eips_print_bottom_centered " " 3
|
|
||||||
eips_print_bottom_centered " " 2
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
eips_print_bottom_centered "Computing zsync delta . . ." 3
|
|
||||||
;;
|
|
||||||
esac
|
|
@ -1,28 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
## First arg is the checkpoint number, and we get one every 200 checkpoints.
|
|
||||||
CHECKPOINT_NUM="${1}"
|
|
||||||
CHECKPOINT_GRANULARITY="200"
|
|
||||||
|
|
||||||
# Use that to build a progress bar
|
|
||||||
PROGRESS_AMOUNT="$((CHECKPOINT_NUM / CHECKPOINT_GRANULARITY))"
|
|
||||||
|
|
||||||
# Which text do we want to use?
|
|
||||||
case "${2}" in
|
|
||||||
"create")
|
|
||||||
PROGRESS_BASE_STRING="Preparing local OTA package"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
PROGRESS_BASE_STRING="Updating KOReader"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# And start drawing the progress bar...
|
|
||||||
PROGRESS_STRING=""
|
|
||||||
for _ in $(seq 1 ${PROGRESS_AMOUNT}); do
|
|
||||||
# Fill the progress bar...
|
|
||||||
PROGRESS_STRING="${PROGRESS_STRING}."
|
|
||||||
done
|
|
||||||
|
|
||||||
# Print our progress :)
|
|
||||||
./fbink -q -y -7 -pmh "${PROGRESS_BASE_STRING}" "${PROGRESS_STRING}"
|
|
Loading…
Reference in New Issue