commit:     d7a1b94fea6aa3e9328d4257077353bcf990a751
Author:     Fredrik Eriksson <feffe <AT> fulh <DOT> ax>
AuthorDate: Tue Jun 24 17:59:50 2025 +0000
Commit:     Craig Andrews <candrews <AT> gentoo <DOT> org>
CommitDate: Sat Jul  5 15:43:31 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d7a1b94f

www-apps/jellyfin-bin: prevent accidental downgrading

Update 10.10.7 ebuild to prevent downgrades from 10.11 which may break
the jellyfin database.

Signed-off-by: Fredrik Eriksson <feffe <AT> fulh.ax>
Part-of: https://github.com/gentoo/gentoo/pull/42686
Closes: https://github.com/gentoo/gentoo/pull/42686
Signed-off-by: Craig Andrews <candrews <AT> gentoo.org>

 www-apps/jellyfin-bin/jellyfin-bin-10.10.7.ebuild | 43 ++++++++++++++++++-----
 1 file changed, 35 insertions(+), 8 deletions(-)

diff --git a/www-apps/jellyfin-bin/jellyfin-bin-10.10.7.ebuild 
b/www-apps/jellyfin-bin/jellyfin-bin-10.10.7.ebuild
index 7d7d863581dd..7b88357b0fdb 100644
--- a/www-apps/jellyfin-bin/jellyfin-bin-10.10.7.ebuild
+++ b/www-apps/jellyfin-bin/jellyfin-bin-10.10.7.ebuild
@@ -3,33 +3,39 @@
 
 EAPI=8
 
-inherit pax-utils systemd tmpfiles
+inherit pax-utils systemd tmpfiles eapi9-ver
 
 DESCRIPTION="Jellyfin puts you in control of managing and streaming your media"
 HOMEPAGE="https://jellyfin.org/
        https://github.com/jellyfin/jellyfin/";
-
+MY_PV="${PV//_rc/-rc}"
+MINOR_VER=$(ver_cut 1-2)
+if [[ ${PV} == *rc* ]]; then
+       MY_TYPE="preview"
+else
+       MY_TYPE="stable"
+       KEYWORDS="-* ~amd64 ~arm64"
+fi
 SRC_URI="
        arm64? (
                elibc_glibc? (
-                       
https://repo.jellyfin.org/files/server/linux/stable/v${PV}/arm64/jellyfin_${PV}-arm64.tar.xz
+                       
https://repo.jellyfin.org/files/server/linux/${MY_TYPE}/v${MY_PV}/arm64/jellyfin_${MY_PV}-arm64.tar.xz
                )
                elibc_musl? (
-                       
https://repo.jellyfin.org/files/server/linux/stable/v${PV}/arm64-musl/jellyfin_${PV}-arm64-musl.tar.xz
+                       
https://repo.jellyfin.org/files/server/linux/${MY_TYPE}/v${MY_PV}/arm64-musl/jellyfin_${MY_PV}-arm64-musl.tar.xz
                )
        )
        amd64? (
                elibc_glibc? (
-                       
https://repo.jellyfin.org/files/server/linux/stable/v${PV}/amd64/jellyfin_${PV}-amd64.tar.xz
+                       
https://repo.jellyfin.org/files/server/linux/${MY_TYPE}/v${MY_PV}/amd64/jellyfin_${MY_PV}-amd64.tar.xz
                )
                elibc_musl? (
-                       
https://repo.jellyfin.org/files/server/linux/stable/v${PV}/amd64-musl/jellyfin_${PV}-amd64-musl.tar.xz
+                       
https://repo.jellyfin.org/files/server/linux/${MY_TYPE}/v${MY_PV}/amd64-musl/jellyfin_${MY_PV}-amd64-musl.tar.xz
                )
        )"
 
 LICENSE="GPL-2"
 SLOT="0"
-KEYWORDS="-* ~amd64 ~arm64"
 RESTRICT="mirror test"
 
 DEPEND="acct-user/jellyfin
@@ -41,7 +47,7 @@ RDEPEND="${DEPEND}
 BDEPEND="acct-user/jellyfin"
 
 INST_DIR="/opt/jellyfin"
-QA_PREBUILT="${INST_DIR#/}/*.so ${INST_DIR#/}/jellyfin 
${INST_DIR#/}/createdump"
+QA_PREBUILT="${INST_DIR#/}/*.so ${INST_DIR#/}/*.so.* ${INST_DIR#/}/jellyfin 
${INST_DIR#/}/createdump"
 
 src_unpack() {
        unpack ${A}
@@ -72,6 +78,27 @@ src_install() {
        pax-mark -m "${ED}${INST_DIR}/jellyfin"
 }
 
+pkg_preinst() {
+       if ver_replacing -gt $MINOR_VER.99; then
+               eerror "Downgrading jellyfin from one minor version to a 
previous one is not supported."
+               eerror "If you wish to downgrade you must uninstall 
jellyfin-bin, restore the database"
+               eerror "from a backup and then reinstall jellyfin-bin."
+               die "Downgrade path not supported"
+       fi
+}
+
 pkg_postinst() {
        tmpfiles_process jellyfin.conf
+
+       if ver_replacing -lt $MINOR_VER; then
+               ewarn "Jellyfin usually makes backward incompatible database 
changes in new minor"
+               ewarn "releases. At first startup after an upgrade jellyfin 
will start a database"
+               ewarn "migration. This may take a long time but must not be 
aborted or the database"
+               ewarn "could be left in an inconsistant state and must be 
recreated or restored from"
+               ewarn "backup. Once the migration has started it is no longer 
possible to downgrade"
+               ewarn "jellyfin without restoring the database from a backup."
+               ewarn ""
+               ewarn "The migration progress can be followed in the startup UI 
in the web browser"
+               ewarn "or in the jellyfin logs."
+       fi
 }

Reply via email to