summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Schmaus <flow@gentoo.org>2024-07-15 21:38:15 +0200
committerFlorian Schmaus <flow@gentoo.org>2024-07-15 21:38:15 +0200
commita4c3e76f042074370e93beb05796a25da93574a1 (patch)
treee39a146a2716db57353413b866f0f2a4598f9906 /app-misc
parentx11-misc/alacarte: Bump to 3.52.0 (diff)
downloadgentoo-a4c3e76f042074370e93beb05796a25da93574a1.tar.gz
gentoo-a4c3e76f042074370e93beb05796a25da93574a1.tar.bz2
gentoo-a4c3e76f042074370e93beb05796a25da93574a1.zip
app-misc/openhab-bin: add update logic
Closes: https://bugs.gentoo.org/935737 Signed-off-by: Florian Schmaus <flow@gentoo.org>
Diffstat (limited to 'app-misc')
-rw-r--r--app-misc/openhab-bin/openhab-bin-4.1.2.ebuild29
1 files changed, 25 insertions, 4 deletions
diff --git a/app-misc/openhab-bin/openhab-bin-4.1.2.ebuild b/app-misc/openhab-bin/openhab-bin-4.1.2.ebuild
index 9c559963aaa1..9b1c384fe722 100644
--- a/app-misc/openhab-bin/openhab-bin-4.1.2.ebuild
+++ b/app-misc/openhab-bin/openhab-bin-4.1.2.ebuild
@@ -3,7 +3,7 @@
EAPI=8
-inherit systemd tmpfiles
+inherit edo systemd tmpfiles
MY_PN=${PN%-bin}
MY_P=${MY_PN}-${PV}
@@ -15,11 +15,13 @@ SRC_URI="
https://raw.githubusercontent.com/openhab/openhab-linuxpkg/10061acd36524afb12a033fea6dcf142b399bf56/resources/usr/bin/openhab-cli
-> openhab-cli-2024-01-14
"
-KEYWORDS="~amd64 ~arm64"
+S="${WORKDIR}"
LICENSE="EPL-2.0"
SLOT="0"
+KEYWORDS="~amd64 ~arm64"
+
MY_JAVA_DEPEND=">=virtual/jre-17"
# app-arch/zip: used by "openhab-cli backup"
@@ -32,8 +34,6 @@ RDEPEND="
BDEPEND="app-arch/unzip"
-S="${WORKDIR}"
-
src_compile() {
:
}
@@ -100,4 +100,25 @@ EOF
pkg_postinst() {
tmpfiles_process openhab.conf
+
+ if [[ -z ${REPLACING_VERSIONS} && -z ${OPENHAB_POSTINST_UPDATE} ]]; then
+ return
+ fi
+
+ if [[ -d "${EROOT}"/run/systemd/system ]]; then
+ if systemctl is-active --quiet openhab; then
+ local openhab_service_active=1
+ einfo "Restarting OpenHAB service due to version update"
+ edob systemctl daemon-reload
+ edob systemctl stop openhab
+ fi
+
+ echo y | edob -m "Cleaning OpenHAB cache" \
+ openhab-cli clean-cache
+ assert "Failed to clean OpenHAB cache"
+
+ if [[ -v openhab_service_active ]]; then
+ edob systemctl start openhab
+ fi
+ fi
}