Skip to content

Commit cec7439

Browse files
Eeemsmatteodelabreraisjn
authored
Stable merge for week 42 of 2021 (#477)
* toltecctl: Honour dependencies when uninstalling (#456) `toltecctl uninstall` will now try to uninstall packages in the reverse order of their dependencies, so that a package can use binaries it depends on during its removal scripts (see #448). Packages in a dependency cycle are removed in an unspecified order. * [rmkit] upgrade remux with rM1 support on 2.9 (#450) this brings remux up to date with rmkit-dev/rmkit@8254893 major improvement is proper support for touch gestures in remux on rM1 after rebooting. the main issue was the display was resizing after remux started, so the touch gestures were using the wrong display size. holding the center button on rM1 would cause remux to restart (and fix this problem), so there is a workaround available. * Update KOReader to 2021.10 (#467) Co-authored-by: raisjn <70462544+raisjn@users.noreply.github.com> * Add cache for dependencies install (#473) * Add cache for dependencies install Co-authored-by: Mattéo Delabre <1370040+matteodelabre@users.noreply.github.com> Co-authored-by: raisjn <70462544+raisjn@users.noreply.github.com> Co-authored-by: Mattéo Delabre <spam@delab.re>
1 parent c1ad0f0 commit cec7439

7 files changed

Lines changed: 117 additions & 81 deletions

File tree

.github/actions/setup/action.yml

Lines changed: 71 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,41 +2,83 @@ name: Setup Toltec dependencies
22
runs:
33
using: "composite"
44
steps:
5-
- name: Install Ubuntu packages
5+
- name: Check for Apt updates
66
shell: bash
77
run: |
88
sudo apt-get update -yq
9-
sudo apt-get install -yq libarchive-tools
10-
- name: Install shfmt and Shellcheck
9+
echo "aptVersion=libarchive-tools-$(apt-cache policy libarchive-tools | grep -oP '(?<=Candidate:\s)(.+)')" >> $GITHUB_ENV
10+
- name: Cache Apt packages
11+
uses: actions/cache@v2
12+
id: cache-apt
13+
with:
14+
path: ~/.aptcache
15+
key: ${{ env.aptVersion }}
16+
- name: Install or restore Apt packages
17+
shell: bash
18+
env:
19+
CACHE_HIT: ${{ steps.cache-apt.outputs.cache-hit }}
20+
run: |
21+
if [[ "$CACHE_HIT" != 'true' ]]; then
22+
sudo apt-get install -yq libarchive-tools
23+
mkdir -p ~/.aptcache
24+
sudo dpkg -L libarchive-tools | while IFS= read -r f; do if test -f $f; then echo $f; fi; done | xargs cp --parents --target-directory ~/.aptcache/
25+
else
26+
sudo cp --verbose --force --recursive ~/.aptcache/* /
27+
fi
28+
- name: Cache shfmt
29+
uses: actions/cache@v2
30+
with:
31+
path: /usr/local/bin/shfmt
32+
key: 43439b996942b53dfafa9b6ff084f394555d049c98fb7ec37978f7668b43e1be
33+
- name: Install shfmt
34+
shell: bash
35+
run: |
36+
install_dir=/usr/local/bin
37+
if ! [[ -f "$install_dir"/shfmt ]]; then
38+
shfmt_version=v3.2.1
39+
shfmt_checksum=43439b996942b53dfafa9b6ff084f394555d049c98fb7ec37978f7668b43e1be
40+
sudo curl --location --silent --fail --tlsv1.2 --proto '=https' \
41+
--output "$install_dir"/shfmt \
42+
https://github.com/mvdan/sh/releases/download/"$shfmt_version"/shfmt_"$shfmt_version"_linux_amd64
43+
sha256sum -c <(echo "$shfmt_checksum $install_dir/shfmt") > /dev/null 2>&1
44+
sudo chmod a+x "$install_dir"/shfmt
45+
fi
46+
- name: Cache Shellcheck
47+
uses: actions/cache@v2
48+
with:
49+
path: /usr/local/bin/shellcheck
50+
key: 64f17152d96d7ec261ad3086ed42d18232fcb65148b44571b564d688269d36c8
51+
- name: Install Shellcheck
1152
shell: bash
1253
run: |
1354
install_dir=/usr/local/bin
14-
15-
# Install shfmt
16-
shfmt_version=v3.2.1
17-
shfmt_checksum=43439b996942b53dfafa9b6ff084f394555d049c98fb7ec37978f7668b43e1be
18-
sudo curl --location --silent --fail --tlsv1.2 --proto '=https' \
19-
--output "$install_dir"/shfmt \
20-
https://github.com/mvdan/sh/releases/download/"$shfmt_version"/shfmt_"$shfmt_version"_linux_amd64
21-
sha256sum -c <(echo "$shfmt_checksum $install_dir/shfmt") > /dev/null 2>&1
22-
sudo chmod a+x "$install_dir"/shfmt
23-
24-
# Install Shellcheck (Ubuntu’s version is too old)
25-
shellcheck_version=v0.7.1
26-
shellcheck_checksum=64f17152d96d7ec261ad3086ed42d18232fcb65148b44571b564d688269d36c8
27-
shellcheck_arname=shellcheck.tar.xz
28-
curl --location --silent --fail --tlsv1.2 --proto '=https' \
29-
--output "$shellcheck_arname" \
30-
https://github.com/koalaman/shellcheck/releases/download/"$shellcheck_version"/shellcheck-"$shellcheck_version".linux.x86_64.tar.xz
31-
sha256sum -c <(echo "$shellcheck_checksum $shellcheck_arname") > /dev/null 2>&1
32-
tar -xf "$shellcheck_arname" --strip-components=1 \
33-
shellcheck-"$shellcheck_version"/shellcheck
34-
rm "$shellcheck_arname"
35-
chmod a+x shellcheck
36-
sudo chown root:root shellcheck
37-
sudo mv shellcheck "$install_dir"
55+
if ! [[ -f "$install_dir"/shellcheck ]];then
56+
shellcheck_version=v0.7.1
57+
shellcheck_checksum=64f17152d96d7ec261ad3086ed42d18232fcb65148b44571b564d688269d36c8
58+
shellcheck_arname=shellcheck.tar.xz
59+
curl --location --silent --fail --tlsv1.2 --proto '=https' \
60+
--output "$shellcheck_arname" \
61+
https://github.com/koalaman/shellcheck/releases/download/"$shellcheck_version"/shellcheck-"$shellcheck_version".linux.x86_64.tar.xz
62+
sha256sum -c <(echo "$shellcheck_checksum $shellcheck_arname") > /dev/null 2>&1
63+
tar -xf "$shellcheck_arname" --strip-components=1 \
64+
shellcheck-"$shellcheck_version"/shellcheck
65+
rm "$shellcheck_arname"
66+
chmod a+x shellcheck
67+
sudo chown root:root shellcheck
68+
sudo mv shellcheck "$install_dir"
69+
fi
70+
- name: Cache Python environment
71+
uses: actions/cache@v2
72+
id: cache-python
73+
with:
74+
path: ${{ env.pythonLocation }}
75+
key: ${{ env.pythonLocation }}-${{ hashFiles('requirements.txt') }}
3876
- name: Install Python dependencies
3977
shell: bash
78+
env:
79+
CACHE_HIT: ${{ steps.cache-python.outputs.cache-hit }}
4080
run: |
41-
python -m pip install --upgrade pip
42-
pip install -r requirements.txt
81+
if [[ "$CACHE_HIT" != 'true' ]]; then
82+
python -m pip install --upgrade pip
83+
pip install -r requirements.txt
84+
fi

package/koreader/package

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
pkgnames=(koreader)
66
pkgdesc="Ebook reader supporting PDF, DjVu, EPUB, FB2 and many more formats"
77
url=https://github.com/koreader/koreader
8-
pkgver=2021.09-2
9-
timestamp=2021-09-20T08:33:06Z
8+
pkgver=2021.10-1
9+
timestamp=2021-10-16T11:37:17Z
1010
section="readers"
1111
maintainer="raisjn <of.raisjn@gmail.com>"
1212
license=AGPL-3.0-or-later
@@ -21,7 +21,7 @@ source=(
2121
koreader
2222
)
2323
sha256sums=(
24-
12ebc96521a390fc10f236e4dc9097fa8bea7e8d6928d474a7966b35a045cd2a
24+
121920ca958a79f5d0187649cf7ff6e9a9d3f485246e7d0aacdf30ddeda60864
2525
SKIP
2626
SKIP
2727
SKIP

package/rmkit/package

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,24 @@
33
# SPDX-License-Identifier: MIT
44

55
pkgnames=(bufshot genie harmony iago lamp mines nao remux simple)
6-
timestamp=2021-03-14T14:20-08:00
6+
timestamp=2021-09-21T14:20-08:00
77
maintainer="raisjn <of.raisjn@gmail.com>"
88
license=MIT
99
installdepends=(display)
1010
flags=(patch_rm2fb)
1111

1212
image=python:v2.1
1313
source=(
14-
https://github.com/rmkit-dev/rmkit/archive/a99b2f70c72539bedc1d201e3899da6e19c197da.zip
15-
patch-remux-duplicate-xochitl.diff
16-
patch-remux-start-xochitl.diff
14+
https://github.com/rmkit-dev/rmkit/archive/8254893999d7334fd14c162d5a15605dcff77ec5.zip
1715
remux.service
1816
genie.service
1917
)
2018
sha256sums=(
21-
db54abfa385017b7d60b1d332efa695756f61caa81644fdadeb4c1b26f8bf923
22-
SKIP
23-
SKIP
19+
977c38d652d8088e9b25c69aff5013b85173be363b5cb341529df261773ff9be
2420
SKIP
2521
SKIP
2622
)
2723

28-
prepare() {
29-
patch -p1 -d"$srcdir" < "$srcdir"/patch-remux-duplicate-xochitl.diff
30-
patch -p1 -d"$srcdir" < "$srcdir"/patch-remux-start-xochitl.diff
31-
rm "$srcdir"/*.diff
32-
}
33-
3424
build() {
3525
pip3 install okp
3626
make
@@ -144,7 +134,7 @@ nao() {
144134
remux() {
145135
pkgdesc="Launcher that supports multi-tasking applications"
146136
url="https://rmkit.dev/apps/remux"
147-
pkgver=0.1.9-5
137+
pkgver=0.1.10-1
148138
section="launchers"
149139

150140
package() {

package/rmkit/patch-remux-duplicate-xochitl.diff

Lines changed: 0 additions & 13 deletions
This file was deleted.

package/rmkit/patch-remux-start-xochitl.diff

Lines changed: 0 additions & 18 deletions
This file was deleted.

package/toltec-bootstrap/package

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@
55
pkgnames=(toltec-bootstrap)
66
pkgdesc="Manage your Toltec install"
77
url=https://toltec-dev.org/
8-
pkgver=0.2.0-1
9-
timestamp=2021-09-25T10:36Z
8+
pkgver=0.2.1-1
9+
timestamp=2021-10-06T07:51Z
1010
section="utils"
1111
maintainer="Eeems <eeems@eeems.email>"
1212
license=MIT
13+
installdepends=(coreutils-tsort)
1314

1415
source=(
1516
toltecctl

package/toltec-bootstrap/toltecctl

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,10 +305,44 @@ reenable() {
305305
set-path
306306
}
307307

308-
# Remove all installed packages
308+
# List all installed packages such that any package comes before
309+
# its dependencies. Dependency cycles are broken arbitrarily
310+
list-installed-ordered() {
311+
# shellcheck disable=SC2016
312+
local awk_list_to_graph='
313+
/^.* depends on:$/{
314+
from=$1;
315+
print from " " from;
316+
}
317+
318+
/^\t/{
319+
print from " " $1;
320+
}
321+
'
322+
opkg depends '*' | awk "$awk_list_to_graph" | tsort 2> /dev/null || true
323+
# tsort reports errors if there are dependency cycles, we ignore them
324+
}
325+
326+
# Remove Toltec completely
309327
uninstall() {
310-
opkg remove --force-depends --force-remove "*"
328+
# Fetch standalone opkg used to uninstall packages
329+
local opkg_path=/home/root/.local/bin/opkg
330+
local opkg_remote=https://bin.entware.net/armv7sf-k3.2/installer/opkg
331+
332+
if ! wget --no-verbose "$opkg_remote" --output-document "$opkg_path"; then
333+
echo "Unable to fetch standalone opkg, make sure you have a stable Wi-Fi connection"
334+
return 1
335+
fi
336+
337+
chmod u+x "$opkg_path"
338+
339+
# Remove installed packages in reverse dependency order
340+
list-installed-ordered | while read -r pkgname; do
341+
"$opkg_path" remove --force-depends --force-remove "$pkgname"
342+
done
343+
311344
systemctl daemon-reload
345+
rm -f "$opkg_path"
312346

313347
# Remove mount point
314348
remove-bind-mount "$toltec_dest"

0 commit comments

Comments
 (0)