mirror of https://github.com/koreader/koreader
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
699ee3efc1
I've played a bit with #6275, to make the iterator available for non-power users too. this PR automate user data migration (which happens once per update). If the folder `koreader/scripts.afterupdate` contains a file `migrate` then files will be copied to internal dir preserving their relative path. Thus user data **needs** to have the same hierarchy as internal directories. Shell scripts will be find and run if the folder `koreader/scripts.afterupdate` exists and has no `migrate file`. In the case of `koreader/scripts.always` there's no migration available, just shell scripts. Digging a bit seems not possible to create new directories on app internal storage (it just crashes on the emulator since API25). So very fancy extensions are not supported, but it is ok to override files and create new files if dir already exists. Tested with: ```find scripts.afterupdate/ scripts.afterupdate/ scripts.afterupdate/data scripts.afterupdate/data/hyph scripts.afterupdate/data/hyph/Roman.pattern scripts.afterupdate/data/example.css scripts.afterupdate/migrate ``` Results: ``` 06-20 16:16:33.590 3584 3597 I KOReader: after-update: running migration 06-20 16:16:33.596 3584 3597 I KOReader: command cp /storage/emulated/0/koreader/scripts.afterupdate/data/hyph/Roman.pattern /data/user/0/org.koreader.launcher/files/data/hyph/Roman.pattern returned 0 06-20 16:16:33.600 3584 3597 I KOReader: command cp /storage/emulated/0/koreader/scripts.afterupdate/data/example.css /data/user/0/org.koreader.launcher/files/data/example.css returned 0 06-20 16:16:33.604 3584 3597 I KOReader: command rm /data/user/0/org.koreader.launcher/files/afterupdate.marker returned 0 ``` |
4 years ago | |
---|---|---|
.. | ||
luajit-launcher@b6eaf1e50f | 4 years ago | |
llapp_main.lua | 4 years ago |