Skip to content

Commit

Permalink
Stable merge for week 42 of 2021 (#477)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>

* Add cache for dependencies install (#473)

* Add cache for dependencies install

Co-authored-by: Mattéo Delabre <[email protected]>
Co-authored-by: raisjn <[email protected]>
Co-authored-by: Mattéo Delabre <[email protected]>
  • Loading branch information
4 people authored Nov 20, 2021
1 parent c1ad0f0 commit cec7439
Show file tree
Hide file tree
Showing 7 changed files with 117 additions and 81 deletions.
100 changes: 71 additions & 29 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,83 @@ name: Setup Toltec dependencies
runs:
using: "composite"
steps:
- name: Install Ubuntu packages
- name: Check for Apt updates
shell: bash
run: |
sudo apt-get update -yq
sudo apt-get install -yq libarchive-tools
- name: Install shfmt and Shellcheck
echo "aptVersion=libarchive-tools-$(apt-cache policy libarchive-tools | grep -oP '(?<=Candidate:\s)(.+)')" >> $GITHUB_ENV
- name: Cache Apt packages
uses: actions/cache@v2
id: cache-apt
with:
path: ~/.aptcache
key: ${{ env.aptVersion }}
- name: Install or restore Apt packages
shell: bash
env:
CACHE_HIT: ${{ steps.cache-apt.outputs.cache-hit }}
run: |
if [[ "$CACHE_HIT" != 'true' ]]; then
sudo apt-get install -yq libarchive-tools
mkdir -p ~/.aptcache
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/
else
sudo cp --verbose --force --recursive ~/.aptcache/* /
fi
- name: Cache shfmt
uses: actions/cache@v2
with:
path: /usr/local/bin/shfmt
key: 43439b996942b53dfafa9b6ff084f394555d049c98fb7ec37978f7668b43e1be
- name: Install shfmt
shell: bash
run: |
install_dir=/usr/local/bin
if ! [[ -f "$install_dir"/shfmt ]]; then
shfmt_version=v3.2.1
shfmt_checksum=43439b996942b53dfafa9b6ff084f394555d049c98fb7ec37978f7668b43e1be
sudo curl --location --silent --fail --tlsv1.2 --proto '=https' \
--output "$install_dir"/shfmt \
https://github.com/mvdan/sh/releases/download/"$shfmt_version"/shfmt_"$shfmt_version"_linux_amd64
sha256sum -c <(echo "$shfmt_checksum $install_dir/shfmt") > /dev/null 2>&1
sudo chmod a+x "$install_dir"/shfmt
fi
- name: Cache Shellcheck
uses: actions/cache@v2
with:
path: /usr/local/bin/shellcheck
key: 64f17152d96d7ec261ad3086ed42d18232fcb65148b44571b564d688269d36c8
- name: Install Shellcheck
shell: bash
run: |
install_dir=/usr/local/bin
# Install shfmt
shfmt_version=v3.2.1
shfmt_checksum=43439b996942b53dfafa9b6ff084f394555d049c98fb7ec37978f7668b43e1be
sudo curl --location --silent --fail --tlsv1.2 --proto '=https' \
--output "$install_dir"/shfmt \
https://github.com/mvdan/sh/releases/download/"$shfmt_version"/shfmt_"$shfmt_version"_linux_amd64
sha256sum -c <(echo "$shfmt_checksum $install_dir/shfmt") > /dev/null 2>&1
sudo chmod a+x "$install_dir"/shfmt
# Install Shellcheck (Ubuntu’s version is too old)
shellcheck_version=v0.7.1
shellcheck_checksum=64f17152d96d7ec261ad3086ed42d18232fcb65148b44571b564d688269d36c8
shellcheck_arname=shellcheck.tar.xz
curl --location --silent --fail --tlsv1.2 --proto '=https' \
--output "$shellcheck_arname" \
https://github.com/koalaman/shellcheck/releases/download/"$shellcheck_version"/shellcheck-"$shellcheck_version".linux.x86_64.tar.xz
sha256sum -c <(echo "$shellcheck_checksum $shellcheck_arname") > /dev/null 2>&1
tar -xf "$shellcheck_arname" --strip-components=1 \
shellcheck-"$shellcheck_version"/shellcheck
rm "$shellcheck_arname"
chmod a+x shellcheck
sudo chown root:root shellcheck
sudo mv shellcheck "$install_dir"
if ! [[ -f "$install_dir"/shellcheck ]];then
shellcheck_version=v0.7.1
shellcheck_checksum=64f17152d96d7ec261ad3086ed42d18232fcb65148b44571b564d688269d36c8
shellcheck_arname=shellcheck.tar.xz
curl --location --silent --fail --tlsv1.2 --proto '=https' \
--output "$shellcheck_arname" \
https://github.com/koalaman/shellcheck/releases/download/"$shellcheck_version"/shellcheck-"$shellcheck_version".linux.x86_64.tar.xz
sha256sum -c <(echo "$shellcheck_checksum $shellcheck_arname") > /dev/null 2>&1
tar -xf "$shellcheck_arname" --strip-components=1 \
shellcheck-"$shellcheck_version"/shellcheck
rm "$shellcheck_arname"
chmod a+x shellcheck
sudo chown root:root shellcheck
sudo mv shellcheck "$install_dir"
fi
- name: Cache Python environment
uses: actions/cache@v2
id: cache-python
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('requirements.txt') }}
- name: Install Python dependencies
shell: bash
env:
CACHE_HIT: ${{ steps.cache-python.outputs.cache-hit }}
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
if [[ "$CACHE_HIT" != 'true' ]]; then
python -m pip install --upgrade pip
pip install -r requirements.txt
fi
6 changes: 3 additions & 3 deletions package/koreader/package
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
pkgnames=(koreader)
pkgdesc="Ebook reader supporting PDF, DjVu, EPUB, FB2 and many more formats"
url=https://github.com/koreader/koreader
pkgver=2021.09-2
timestamp=2021-09-20T08:33:06Z
pkgver=2021.10-1
timestamp=2021-10-16T11:37:17Z
section="readers"
maintainer="raisjn <[email protected]>"
license=AGPL-3.0-or-later
Expand All @@ -21,7 +21,7 @@ source=(
koreader
)
sha256sums=(
12ebc96521a390fc10f236e4dc9097fa8bea7e8d6928d474a7966b35a045cd2a
121920ca958a79f5d0187649cf7ff6e9a9d3f485246e7d0aacdf30ddeda60864
SKIP
SKIP
SKIP
Expand Down
18 changes: 4 additions & 14 deletions package/rmkit/package
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,24 @@
# SPDX-License-Identifier: MIT

pkgnames=(bufshot genie harmony iago lamp mines nao remux simple)
timestamp=2021-03-14T14:20-08:00
timestamp=2021-09-21T14:20-08:00
maintainer="raisjn <[email protected]>"
license=MIT
installdepends=(display)
flags=(patch_rm2fb)

image=python:v2.1
source=(
https://github.com/rmkit-dev/rmkit/archive/a99b2f70c72539bedc1d201e3899da6e19c197da.zip
patch-remux-duplicate-xochitl.diff
patch-remux-start-xochitl.diff
https://github.com/rmkit-dev/rmkit/archive/8254893999d7334fd14c162d5a15605dcff77ec5.zip
remux.service
genie.service
)
sha256sums=(
db54abfa385017b7d60b1d332efa695756f61caa81644fdadeb4c1b26f8bf923
SKIP
SKIP
977c38d652d8088e9b25c69aff5013b85173be363b5cb341529df261773ff9be
SKIP
SKIP
)

prepare() {
patch -p1 -d"$srcdir" < "$srcdir"/patch-remux-duplicate-xochitl.diff
patch -p1 -d"$srcdir" < "$srcdir"/patch-remux-start-xochitl.diff
rm "$srcdir"/*.diff
}

build() {
pip3 install okp
make
Expand Down Expand Up @@ -144,7 +134,7 @@ nao() {
remux() {
pkgdesc="Launcher that supports multi-tasking applications"
url="https://rmkit.dev/apps/remux"
pkgver=0.1.9-5
pkgver=0.1.10-1
section="launchers"

package() {
Expand Down
13 changes: 0 additions & 13 deletions package/rmkit/patch-remux-duplicate-xochitl.diff

This file was deleted.

18 changes: 0 additions & 18 deletions package/rmkit/patch-remux-start-xochitl.diff

This file was deleted.

5 changes: 3 additions & 2 deletions package/toltec-bootstrap/package
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
pkgnames=(toltec-bootstrap)
pkgdesc="Manage your Toltec install"
url=https://toltec-dev.org/
pkgver=0.2.0-1
timestamp=2021-09-25T10:36Z
pkgver=0.2.1-1
timestamp=2021-10-06T07:51Z
section="utils"
maintainer="Eeems <[email protected]>"
license=MIT
installdepends=(coreutils-tsort)

source=(
toltecctl
Expand Down
38 changes: 36 additions & 2 deletions package/toltec-bootstrap/toltecctl
Original file line number Diff line number Diff line change
Expand Up @@ -305,10 +305,44 @@ reenable() {
set-path
}

# Remove all installed packages
# List all installed packages such that any package comes before
# its dependencies. Dependency cycles are broken arbitrarily
list-installed-ordered() {
# shellcheck disable=SC2016
local awk_list_to_graph='
/^.* depends on:$/{
from=$1;
print from " " from;
}
/^\t/{
print from " " $1;
}
'
opkg depends '*' | awk "$awk_list_to_graph" | tsort 2> /dev/null || true
# tsort reports errors if there are dependency cycles, we ignore them
}

# Remove Toltec completely
uninstall() {
opkg remove --force-depends --force-remove "*"
# Fetch standalone opkg used to uninstall packages
local opkg_path=/home/root/.local/bin/opkg
local opkg_remote=https://bin.entware.net/armv7sf-k3.2/installer/opkg

if ! wget --no-verbose "$opkg_remote" --output-document "$opkg_path"; then
echo "Unable to fetch standalone opkg, make sure you have a stable Wi-Fi connection"
return 1
fi

chmod u+x "$opkg_path"

# Remove installed packages in reverse dependency order
list-installed-ordered | while read -r pkgname; do
"$opkg_path" remove --force-depends --force-remove "$pkgname"
done

systemctl daemon-reload
rm -f "$opkg_path"

# Remove mount point
remove-bind-mount "$toltec_dest"
Expand Down

0 comments on commit cec7439

Please sign in to comment.