New real terminal emulator, replacing the old plugin.
The emulator is basically a vt52 terminal (enriched with
some ANSI-sequences, as ash, vi and mksh don't behave well
on a vt52 term).
So far working: ash, mksh, bash, nano, vi, busybox, watch...
The input supports: tab-completion; cursor movement;
backspace; start of line, end of line (long press);
page up, page down (long press).
User scripts may be placed in the koterm.koplugin/scripts/
folder, aliases can be put in the file aliases and startup
command in the file profile.user in that folder.
* Run grep against /proc/modules directly instead of forking to lsmod
* Revamp the CPUFreq governor choice logic
I finally figured out why the scaling on the H2O was so wonky:
Because it relies on an obscure i.MX hardware feature called DVFS,
and it gets flipped for mysterious workaround-y reasons depending on
Wi-Fi state...
* Start playing with conservative, because just staying pegged at max
clock is entirely stupid.
And DVFS is extremely conservative, it needs somewhat sustained load to
clock up...
* Take care of the DVFS switcheroo in the Wi-Fi scripts
Update shellcheck and shfmt to the latest version.
Fixes <https://github.com/koreader/koreader/issues/5152>.
Btw, you can apply shellcheck suggestions with a command like:
```
shellcheck --include=SC2250 -f diff *.sh | git apply
```
If only 1 line changed, it's just the timestamp. Otherwise every commit in the main repo will result in a useless one in koreader/koreader-translations, such as <eadc9f133a>.
This commit standardizes the various todos around the code a bit in a manner recognized by LDoc.
Besides drawing more attention by being displayed in the developer docs, they're also extractable with LDoc on the command line:
```sh
ldoc --tags todo,fixme *.lua
```
However, whether that particular usage offers any advantage over other search tools is questionable at best.
* and some random beautification
add support for runtime permissions on api23+
add support for devices with a notch on api28+
fix some potential memory leaks
do not check luajit-launcher shell scripts
Follow-up to https://github.com/koreader/koreader/pull/4524
The regex in the Python wasn't actually picking up on that style of writing it at all, because it's not only ugly, but also so counter-intuitive that I overlooked to test for and add support for it.
```
_(
[[
```
It'd be easy to fix up the Python regex a little, and perhaps I will,
but either way it makes more sense to automatically enforce this as a coding standard.
Apply junit testcase time fix so CircleCI can actually do something useful
with the results. This can be removed once there is a busted 2.0.rc13 or final
See 830f175c57
* junit test results; unfortunately this seems to conflict with the verbose out
* fix deps cache: two files can change independently
* verbose print obsoleted by gtest in upsream busted
The debug output from Coveralls was rubbish. `"Build processing error"`
Besides some basics like checking if we were actually sending
valid JSON that gives us absolutely nothing to work with.
I wrote this whole complicated wofkflow-based config file, but except
in the case of a base rebuild it wouldn't really be any faster than
this simple tweak.
```
defaults: &defaults
docker:
- image: houqp/kobase:0.0.5
environment:
EMULATE_READER: 1
# this is for shellcheck 0.4.5 and lower; can be removed for 0.4.6
LC_ALL: en_US.UTF8
version: 2
jobs:
install-and-build:
<<: *defaults
steps:
- checkout
- restore_cache:
keys:
# binary dependencies require {{ arch }} because there are different CPUs in use on the servers
- deps-{{ arch }}-{{ checksum ".ci/install.sh" }}
# need to init some stuff first or git will complain when sticking in base cache
- run: git submodule init base && git submodule update base && pushd base && git submodule init && git submodule update && popd
# we can't use command output directly for cache check so we write it to git-rev-base
- run: pushd base && git_rev_base=$(git describe HEAD) && popd && echo $git_rev_base && echo $git_rev_base >git-rev-base
- restore_cache:
keys:
- build-{{ arch }}-{{ checksum "git-rev-base" }}
- run: echo 'export PATH=${HOME}/bin:${PATH}' >> $BASH_ENV
- run:
name: setup
command: .ci/before_install.sh
- run:
name: install
command: .ci/install.sh
- save_cache:
key: deps-{{ arch }}-{{ checksum ".ci/install.sh" }}
paths:
- "/home/ko/bin"
- "/home/ko/.luarocks"
# compiled luarocks binaries
- "install"
- run:
name: fetch
command: .ci/fetch.sh
- run:
name: check
command: .ci/check.sh
- run:
name: build
command: .ci/build.sh
- save_cache:
key: build-{{ checksum "base/git-rev" }}
paths:
- "/home/ko/.ccache"
- "base"
- persist_to_workspace:
# Must be an absolute path, or relative path from working_directory
root: "./"
# Must be relative path from root
paths:
# front build
- "koreader-emulator-x86_64-linux-gnu/koreader"
test:
<<: *defaults
parallelism: 4
steps:
- checkout
- restore_cache:
keys:
# binary dependencies require {{ arch }} because there are different CPUs in use on the servers
- deps-{{ arch }}-{{ checksum ".ci/install.sh" }}
# need to init some stuff first or git will complain when sticking in base cache
- run: git submodule init base && git submodule update base && pushd base && git submodule init && git submodule update && popd
# we can't use command output directly for cache check so we write it to git-rev-base
- run: pushd base && git_rev_base=$(git describe HEAD) && popd && echo $git_rev_base && echo $git_rev_base >git-rev-base
- restore_cache:
keys:
- build-{{ arch }}-{{ checksum "git-rev-base" }}
- run: echo 'export PATH=${HOME}/bin:${PATH}' >> $BASH_ENV
- attach_workspace:
# Must be absolute path or relative path from working_directory
at: "./"
- run:
name: test
command: .ci/test.sh
docs-and-coverage:
<<: *defaults
steps:
- checkout
- restore_cache:
keys:
# binary dependencies require {{ arch }} because there are different CPUs in use on the servers
- deps-{{ arch }}-{{ checksum ".ci/install.sh" }}
# need to init some stuff first or git will complain when sticking in base cache
- run: git submodule init base && git submodule update base && pushd base && git submodule init && git submodule update && popd
# we can't use command output directly for cache check so we write it to git-rev-base
- run: pushd base && git_rev_base=$(git describe HEAD) && popd && echo $git_rev_base && echo $git_rev_base >git-rev-base
- restore_cache:
keys:
- build-{{ arch }}-{{ checksum "git-rev-base" }}
- run: echo 'export PATH=${HOME}/bin:${PATH}' >> $BASH_ENV
- attach_workspace:
# Must be absolute path or relative path from working_directory
at: "./"
- run:
name: cleanup
command: .ci/after_success.sh
workflows:
version: 2
build-and-test:
jobs:
- install-and-build
- test:
requires:
- install-and-build
- docs-and-coverage:
requires:
- install-and-build
```
* Enable parallelism in .circleci/config.yml
* Add BUSTED_SPEC_FILE to Makefile testfront
* Use it in .ci/test.sh with xargs for test parallelization
NB This is the dumb method of improving test time.
Ideally we want a workflow fan-in/fan-out approach.
* shellcheck 0.4.5 fix `LC_ALL: en_US.UTF8` (can be removed for shellcheck 0.4.6)
* hush updated luacheck on `reader.lua`; we're not assigning any variables but `= nil` is redundant
Parsing and rasterisation provided by nanosvg (some svg tags like text,
span and images are not supported).
Only svg image included as files in the .epub are supported
(embedded svg tags in html are not).
Holding on svg image shows it 4x zoomed in ImageViewer.
* translation text fix
* quickstart(fix): go back to home dir after document close
* quickstart(fix): purge old quick start files
* spec: fix quickstart tests
Travis only makes a shallow clone of --depth=50. KOReader is small enough that we can just grab it all. This is necessary to generate the version number, without which some tests will fail.
I'm not entirely sure why something like `git fetch origin master tags/v2015.11` doesn't do the trick, but it doesn't matter much.
* Travis: speed up by caching base and running luacheck earlier
* ignore bin and install for git status change detection
* skip coverage except on official master branch. It adds 3 whole minutes and does nothing to prevent regressions
* also cache ~/.luarocks. It evens out but would generally prevent remote timeout shenenigans
* remove base cache dir before caching with verbose remove to see what's going on
* more inclusive shell code quality analysis
* fixed more shellcheck issues
* better shellcheck/shfmt debugging info