Skip to content

Commit

Permalink
Fix #638
Browse files Browse the repository at this point in the history
  • Loading branch information
Eeems committed Aug 18, 2023
1 parent 5ca1fc5 commit a0f3135
Show file tree
Hide file tree
Showing 12 changed files with 53 additions and 66 deletions.
8 changes: 3 additions & 5 deletions package/display/package
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ timestamp=2023-04-16T20:53:38Z
maintainer="raisjn <[email protected]>"
license=MIT
url="https://github.com/ddvk/remarkable2-framebuffer"
pkgver=1:0.0.31-2
pkgver=1:0.0.31-3
_release="${pkgver%-*}"
_release="v${_release#*:}"
_libver=1.0.1
Expand Down Expand Up @@ -72,7 +72,7 @@ display() {
systemctl restart xochitl
fi
else
systemctl disable rm2fb --now
disable-unit rm2fb.service
echo "Failed to start rm2fb. Keeping it disabled for now."
echo "Please check the logs and open an issue:"
echo " https://github.com/toltec-dev/toltec/issues/new"
Expand All @@ -83,9 +83,7 @@ display() {

preremove() {
if [[ $arch = rm2 ]]; then
if systemctl list-units --full -all | grep -Fq 'rm2fb.service'; then
systemctl disable rm2fb --now
fi
disable-unit rm2fb.service
echo -n "make sure "
if ! is-enabled xochitl.service; then
echo "to re-enable xochitl with 'systemctl enable xochitl --now'"
Expand Down
7 changes: 2 additions & 5 deletions package/draft/package
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
pkgnames=(draft)
pkgdesc="Launcher which wraps around the standard interface"
url=https://github.com/dixonary/draft-reMarkable
pkgver=0.2.0-21
pkgver=0.2.0-22
timestamp=2020-07-20T10:23Z
section="launchers"
maintainer="Mattéo Delabre <[email protected]>"
Expand Down Expand Up @@ -60,10 +60,7 @@ configure() {
}

preremove() {
if systemctl list-units --full -all | grep -Fq "$pkgname.service"; then
echo "Disabling $pkgname"
systemctl disable --now "$pkgname"
fi
disable-unit "$pkgname.service"
}

postremove() {
Expand Down
12 changes: 2 additions & 10 deletions package/koreader/package
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
pkgnames=(koreader)
pkgdesc="Ebook reader supporting PDF, DjVu, EPUB, FB2 and many more formats"
url=https://github.com/koreader/koreader
pkgver=2023.06.1-1
pkgver=2023.06.1-2
timestamp=2023-07-09T08:17:26Z
section="readers"
maintainer="raisjn <[email protected]>"
Expand Down Expand Up @@ -62,15 +62,7 @@ MSG
}

preremove() {
if is-active "$pkgname"; then
echo "Stopping $pkgname"
systemctl stop "$pkgname"
fi

if is-enabled "$pkgname"; then
echo "Disabling $pkgname"
systemctl disable "$pkgname"
fi
disable-unit "$pkgname.service"
}

postremove() {
Expand Down
11 changes: 2 additions & 9 deletions package/oxide/package
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# SPDX-License-Identifier: MIT

pkgnames=(erode fret oxide rot tarnish decay corrupt anxiety liboxide libsentry notify-send)
pkgver=2.5-2
pkgver=2.5-3
_sentryver=0.5.0
timestamp=2023-01-26T22:52:14Z
maintainer="Eeems <[email protected]>"
Expand Down Expand Up @@ -99,14 +99,7 @@ tarnish() {
systemctl daemon-reload
}
preremove() {
if is-active tarnish; then
echo "Stopping tarnish"
systemctl stop tarnish
fi
if is-enabled tarnish; then
echo "Disabling tarnish"
systemctl disable tarnish
fi
disable-unit tarnish.service
}
postremove() {
systemctl daemon-reload
Expand Down
6 changes: 2 additions & 4 deletions package/reboot-guard/package
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
pkgnames=(reboot-guard)
pkgdesc="Block systemd-initiated poweroff/reboot/halt until configurable condition checks pass"
url=https://github.com/stephanritscher/reboot-guard
pkgver=1.0.1-6
pkgver=1.0.1-7
timestamp=2020-05-04T06:16Z
section="devel"
maintainer="Eeems <[email protected]>"
Expand Down Expand Up @@ -34,9 +34,7 @@ configure() {
}

preremove() {
if systemctl list-units --full -all | grep -Fq 'rguard.service'; then
systemctl disable --now rguard
fi
disable-unit rguard.service
}

postremove() {
Expand Down
4 changes: 2 additions & 2 deletions package/rmfakecloud-proxy/package
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pkgdesc="Connect Xochitl to a rmfakecloud server"
_url=https://github.com/ddvk/rmfakecloud-proxy
url="$_url"
_upver=0.0.3
pkgver="$_upver-3"
pkgver="$_upver-4"
timestamp=2022-02-26T22:59Z
section="utils"
maintainer="Mattéo Delabre <[email protected]>"
Expand Down Expand Up @@ -55,7 +55,7 @@ configure() {
install-hosts
else
uninstall-certificates
systemctl disable --now rmfakecloud-proxy
disable-unit rmfakecloud-proxy.service
uninstall-hosts
fi

Expand Down
10 changes: 4 additions & 6 deletions package/rmkit/package
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ dumbskull() {
genie() {
pkgdesc="Gesture engine that connects commands to gestures"
url="https://rmkit.dev/apps/genie"
pkgver=0.1.6-2
pkgver=0.1.6-3
section="utils"

package() {
Expand All @@ -68,8 +68,7 @@ genie() {
}

preremove() {
echo "Disabling $pkgname"
systemctl disable --now "$pkgname"
disable-unit "$pkgname.service"
}

postremove() {
Expand Down Expand Up @@ -147,7 +146,7 @@ nao() {
remux() {
pkgdesc="Launcher that supports multi-tasking applications"
url="https://rmkit.dev/apps/remux"
pkgver=0.2.4-1
pkgver=0.2.4-2
section="launchers"

package() {
Expand All @@ -167,8 +166,7 @@ remux() {
}

preremove() {
echo "Disabling $pkgname"
systemctl disable --now "$pkgname"
disable-unit "$pkgname.service"
}

postremove() {
Expand Down
12 changes: 2 additions & 10 deletions package/tailscale-systemd/package
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
pkgnames=(tailscale-systemd)
pkgdesc="SystemD configuration for tailscale"
url=https://tailscale.com
pkgver=0.0.0-1
pkgver=0.0.0-2
section="utils"
timestamp=2023-07-12T00:00Z
maintainer="Kai <[email protected]>"
Expand All @@ -30,15 +30,7 @@ configure() {
}

preremove() {
if is-active tailscaled; then
echo "Stopping tailscaled"
systemctl stop tailscaled
fi

if is-enabled tailscaled; then
echo "Disabling tailscaled"
systemctl disable tailscaled
fi
disable-unit "tailscaled.service"
}

postremove() {
Expand Down
4 changes: 2 additions & 2 deletions package/toltec-base/package
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ archs=(rm1 rm2)
pkgnames=(toltec-base)
pkgdesc="Metapackage defining the base set of packages in a Toltec install"
url=https://toltec-dev.org/
pkgver=1.2-2
pkgver=1.2-3
timestamp=2023-05-08T19:31Z
section="utils"
maintainer="Eeems <[email protected]>"
Expand All @@ -31,7 +31,7 @@ configure() {
/opt/etc/profile
if is-enabled "update-engine.service"; then
echo "Disabling automatic update"
systemctl disable --now update-engine
disable-unit update-engine.service
fi
if [[ "$arch" == "rm1" ]] && ! is-masked sys-subsystem-net-devices-usb1.device; then
echo "Disabling usb1 network device to avoid long boots"
Expand Down
11 changes: 2 additions & 9 deletions package/webinterface-wifi/package
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
pkgnames=(webinterface-wifi)
pkgdesc="View the web interface if running, over wifi"
url="https://github.com/rM-self-serve/webinterface-wifi"
pkgver=1.0.2-1
pkgver=1.0.2-2
timestamp=2023-02-06T12:23:17Z
section="utils"
maintainer="rM-self-serve <[email protected]>"
Expand Down Expand Up @@ -42,14 +42,7 @@ configure() {
}

preremove() {
if is-active "$pkgname"; then
echo "Stopping $pkgname"
systemctl stop "$pkgname"
fi
if is-enabled "$pkgname"; then
echo "Disabling $pkgname"
systemctl disable "$pkgname"
fi
disable-unit "$pkgname.service"
}

postremove() {
Expand Down
6 changes: 2 additions & 4 deletions package/xochitl/package
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
pkgnames=(xochitl)
pkgdesc="Read documents and take notes"
url=https://remarkable.com
pkgver=0.0.0-14
pkgver=0.0.0-15
timestamp=2022-11-07T20:19:57Z
section="readers"
maintainer="Mattéo Delabre <[email protected]>"
Expand Down Expand Up @@ -83,9 +83,7 @@ configure() {
}

preremove() {
if is-active manual-sync.service; then
systemctl disable --now manual-sync.service
fi
disable-unit manual-sync.service
}

postremove() {
Expand Down
28 changes: 28 additions & 0 deletions scripts/install-lib
Original file line number Diff line number Diff line change
Expand Up @@ -174,3 +174,31 @@ remove-bind-mount() {
rm "$unit_path"
systemctl daemon-reload
}

# Check to see if a systemd unit exists
#
# Arguments:
#
# $1 - Full name of the systemd unit, e.g. "draft.service"
unit-exists() {
[ $(systemctl --quiet list-unit-files "${1}" | grep "${1}" | wc -l) -eq 1 ]
}

# Stops and disabled a unit
#
# Arguments:
#
# $1 - Full name of the systemd unit, e.g. "draft.service"
disable-unit() {
if ! unit-exists "$1"; then
return
fi
if is-active "$1"; then
echo "Stopping $1"
systemctl stop "$1"
fi
if is-enabled "$1"; then
echo "Disabling $1"
systemctl disable "$1"
fi
}

0 comments on commit a0f3135

Please sign in to comment.