From 965b4044a7c11e7448bb4f36f59b5364a7f81822 Mon Sep 17 00:00:00 2001 From: maxrogers Date: Mon, 29 Mar 2021 02:11:21 -0600 Subject: [PATCH] Update Sonarr to v3 (#3803) * Update Sonarr to v3-stable * Sonarr: remove busybox * Sonarr: fix file doesn't exists and file exists errors * Add https Co-authored-by: Sebastian Schmidt * change to PKG_NAME Co-authored-by: hgy59 * Sonarr: Smooth migration from nzbdrone Framework: add install_replace_packages, install_break_packages and checkport Note: In the future (DSM7) prereplace and postreplace scrips should be used instead * Revert "Sonarr: Smooth migration from nzbdrone" This reverts commit 4d88fa9c2248c03a0e24bb45635f79e0e22d7e32. Co-authored-by: Sebastian Schmidt Co-authored-by: hgy59 --- cross/sonarr/Makefile | 10 ++++---- cross/sonarr/PLIST | 2 +- cross/sonarr/digests | 6 ++--- spk/sonarr/Makefile | 9 +++---- spk/sonarr/src/service-setup.sh | 30 ++++++++++-------------- spk/sonarr/src/wizard/upgrade_uifile | 7 +++++- spk/sonarr/src/wizard/upgrade_uifile_fre | 7 +++++- 7 files changed, 37 insertions(+), 34 deletions(-) diff --git a/cross/sonarr/Makefile b/cross/sonarr/Makefile index d59e0091cc8..124f5dcd5e2 100644 --- a/cross/sonarr/Makefile +++ b/cross/sonarr/Makefile @@ -1,9 +1,9 @@ -PKG_NAME = NzbDrone -PKG_VERS = 2.0.0.5344 +PKG_NAME = Sonarr +PKG_VERS = 3.0.5.1144 PKG_EXT = tar.gz -PKG_DIST_NAME = $(PKG_NAME).master.$(PKG_VERS).mono.$(PKG_EXT) -PKG_DIST_SITE = https://download.sonarr.tv/v2/master/mono -PKG_DIR = NzbDrone +PKG_DIST_NAME = $(PKG_NAME).main.$(PKG_VERS).linux.$(PKG_EXT) +PKG_DIST_SITE = https://download.sonarr.tv/v3/main/$(PKG_VERS) +PKG_DIR = $(PKG_NAME) DEPENDS = diff --git a/cross/sonarr/PLIST b/cross/sonarr/PLIST index 34e06becfab..d44fd9d065c 100644 --- a/cross/sonarr/PLIST +++ b/cross/sonarr/PLIST @@ -1 +1 @@ -rsc:share/NzbDrone +rsc:share/Sonarr diff --git a/cross/sonarr/digests b/cross/sonarr/digests index 205bb5b3ac8..6f290ee677a 100644 --- a/cross/sonarr/digests +++ b/cross/sonarr/digests @@ -1,3 +1,3 @@ -NzbDrone.master.2.0.0.5344.mono.tar.gz SHA1 223ea825e9968a25d4b376fe529eba2258a5a326 -NzbDrone.master.2.0.0.5344.mono.tar.gz SHA256 2a15cb9dfa45eb34558fccdc9a1611028790b56a1b59c7407c27c726ea715d2f -NzbDrone.master.2.0.0.5344.mono.tar.gz MD5 cad83d5f4885af1f62f802899903c6f8 +Sonarr.main.3.0.5.1144.linux.tar.gz SHA1 2335133139a46f1ce0d1b2cb1f566d30285d3d1e +Sonarr.main.3.0.5.1144.linux.tar.gz SHA256 77aff6978d4dc80027979c815bd5a79579dd9bb50d39b1b2d14b3bb9e18058aa +Sonarr.main.3.0.5.1144.linux.tar.gz MD5 675ce0ab2f1e643860ab1daab45b2842 diff --git a/spk/sonarr/Makefile b/spk/sonarr/Makefile index fa1d7a1d255..060ff440d37 100644 --- a/spk/sonarr/Makefile +++ b/spk/sonarr/Makefile @@ -1,12 +1,12 @@ SPK_NAME = nzbdrone SPK_VERS = $(shell date +%Y%m%d) -SPK_REV = 18 +SPK_REV = 19 SPK_ICON = src/sonarr.png # Mono not supported on ppc platforms. C.f. cross/mono/Makefile and references therein for details. UNSUPPORTED_ARCHS = $(PPC_ARCHS) -DEPENDS = cross/busybox cross/curl cross/mediainfo cross/sqlite cross/sonarr +DEPENDS = cross/curl cross/mediainfo cross/sqlite cross/sonarr SPK_DEPENDS = "mono>3.6" @@ -17,7 +17,7 @@ DESCRIPTION_SPN = Sonarr es un PVR para los usuarios de grupos de noticias y tor RELOAD_UI = yes DISPLAY_NAME = Sonarr STARTABLE = yes -CHANGELOG = "Update openssl to 1.1." +CHANGELOG = "Update Sonarr to v3.0.5.1144" HOMEPAGE = https://sonarr.tv LICENSE = GPLv3 @@ -34,9 +34,6 @@ WIZARDS_DIR = src/wizard/ POST_STRIP_TARGET = sonarr_extra_install -BUSYBOX_CONFIG = usrmng -ENV += BUSYBOX_CONFIG="$(BUSYBOX_CONFIG)" - include ../../mk/spksrc.spk.mk .PHONY: sonarr_extra_install diff --git a/spk/sonarr/src/service-setup.sh b/spk/sonarr/src/service-setup.sh index b7cb40ad91d..2eae5d5c7ab 100644 --- a/spk/sonarr/src/service-setup.sh +++ b/spk/sonarr/src/service-setup.sh @@ -42,17 +42,8 @@ SVC_BACKGROUND=y service_postinst () { + mkdir -p ${CONFIG_DIR} set_unix_permissions "${CONFIG_DIR}" - - # If necessary, add user also to the old group before removing it - syno_user_add_to_legacy_group "${EFF_USER}" "${USER}" "${LEGACY_GROUP}" - syno_user_add_to_legacy_group "${EFF_USER}" "${USER}" "users" - - # Discard legacy obsolete busybox user account - BIN=${SYNOPKG_PKGDEST}/bin - $BIN/busybox --install $BIN >> ${INST_LOG} - $BIN/delgroup "${USER}" "users" >> ${INST_LOG} - $BIN/deluser "${USER}" >> ${INST_LOG} } service_preupgrade () @@ -62,10 +53,11 @@ service_preupgrade () # The /var/ folder gets automatically copied by service-installer after this if [ -d "${LEGACY_CONFIG_DIR}" ]; then echo "Moving ${LEGACY_CONFIG_DIR} to ${INST_VAR}" >> ${INST_LOG} - mv ${LEGACY_CONFIG_DIR} ${CONFIG_DIR} >> ${LOG_FILE} 2>&1 - else + mv ${LEGACY_CONFIG_DIR} ${CONFIG_DIR} >> ${INST_LOG} 2>&1 + fi + if [ ! -d ${CONFIG_DIR} ]; then # Create, in case it's missing for some reason - mkdir ${CONFIG_DIR} >> ${LOG_FILE} 2>&1 + mkdir -p ${CONFIG_DIR} >> ${INST_LOG} 2>&1 fi # Is Installed Sonarr Binary Ver. >= SPK Sonarr Binary Ver.? @@ -90,8 +82,8 @@ service_postupgrade () . ${CONFIG_DIR}/KEEP_VAR if [ "$KEEP_CUR" == "yes" ]; then echo "Restoring Sonarr version from before upgrade" >> ${INST_LOG} - rm -fr ${SYNOPKG_PKGDEST}/share >> $INST_LOG 2>&1 - mv ${INST_VAR}/share ${SYNOPKG_PKGDEST}/ >> $INST_LOG 2>&1 + rm -fr ${SYNOPKG_PKGDEST}/share >> ${INST_LOG} 2>&1 + mv ${INST_VAR}/share ${SYNOPKG_PKGDEST}/ >> ${INST_LOG} 2>&1 set_unix_permissions "${SYNOPKG_PKGDEST}/share" fi @@ -99,8 +91,12 @@ service_postupgrade () # If backup was created before new-style packages # new updates/backups will fail due to permissions (see #3185) - set_unix_permissions "/tmp/nzbdrone_backup" - set_unix_permissions "/tmp/nzbdrone_update" + if [ -d "/tmp/nzbdrone_backup" ] || [ -d "/tmp/nzbdrone_update" ] || [ -d "/tmp/sonarr_backup" ] || [ -d "/tmp/sonarr_update" ]; then + set_unix_permissions "/tmp/nzbdrone_backup" + set_unix_permissions "/tmp/nzbdrone_update" + set_unix_permissions "/tmp/sonarr_backup" + set_unix_permissions "/tmp/sonarr_update" + fi # Remove upgrade Flag rm ${CONFIG_DIR}/KEEP_VAR diff --git a/spk/sonarr/src/wizard/upgrade_uifile b/spk/sonarr/src/wizard/upgrade_uifile index f195d7af176..c564b4c4d44 100644 --- a/spk/sonarr/src/wizard/upgrade_uifile +++ b/spk/sonarr/src/wizard/upgrade_uifile @@ -1,7 +1,12 @@ [{ + "step_title": "RECOMMENDATION: Download A Backup Before Upgrading", + "items": [{ + "desc": "IMPORTANT: This update is an upgrade to Sonarr v3. We suggest that you download a manual backup as a precautionary measure before installing this update.

You can download a backup via Sonarr's built-in web-interface.
To do this, navigate to System>Backup in the Sonarr UI.

Create a backup and then download a copy of that backup before installing this upgrade." + }] +},{ "step_title": "Updating Sonarr", "items": [{ - "desc": "Keep Sonarr up-to-date by using Sonarr's built-in updater.
Navigate to System>Updates in the Sonarr UI." + "desc": "Keep Sonarr up-to-date by using Sonarr's built-in updater.
Navigate to System>Updates in the Sonarr UI." }] },{ "step_title": "Attention! DSM Permissions", diff --git a/spk/sonarr/src/wizard/upgrade_uifile_fre b/spk/sonarr/src/wizard/upgrade_uifile_fre index 91a1d754233..0f7fb188c3a 100644 --- a/spk/sonarr/src/wizard/upgrade_uifile_fre +++ b/spk/sonarr/src/wizard/upgrade_uifile_fre @@ -1,7 +1,12 @@ [{ + "step_title": "RECOMMENDATION: Télécharger une sauvegarde avant la mise à niveau", + "items": [{ + "desc": "IMPORTANT: Cette mise à jour est une mise à niveau vers Sonarr v3. Nous vous suggérons de télécharger une sauvegarde manuelle par mesure de précaution avant d'installer cette mise à jour.

Vous pouvez télécharger une sauvegarde via l'interface Web intégrée de Sonarr.
Pour ce faire, accédez à System>Backup dans l'interface utilisateur Sonarr.

Créez une sauvegarde, puis téléchargez une copie de cette sauvegarde avant d'installer cette mise à niveau." + }] +},{ "step_title": "Mettre à jour Sonarr", "items": [{ - "desc": "Garder Sonarr à jour en utilisant System>Updates dans l'interface Sonarr." + "desc": "Garder Sonarr à jour en utilisant System>Updates dans l'interface Sonarr." }] },{ "step_title": "Attention! Permissions DSM",