Skip to content

Commit

Permalink
Update Sonarr to v3 (SynoCommunity#3803)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>

* change to PKG_NAME

Co-authored-by: hgy59 <[email protected]>

* 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 4d88fa9.

Co-authored-by: Sebastian Schmidt <[email protected]>
Co-authored-by: hgy59 <[email protected]>
  • Loading branch information
3 people authored Mar 29, 2021
1 parent 2f2428c commit 965b404
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 34 deletions.
10 changes: 5 additions & 5 deletions cross/sonarr/Makefile
Original file line number Diff line number Diff line change
@@ -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 =

Expand Down
2 changes: 1 addition & 1 deletion cross/sonarr/PLIST
Original file line number Diff line number Diff line change
@@ -1 +1 @@
rsc:share/NzbDrone
rsc:share/Sonarr
6 changes: 3 additions & 3 deletions cross/sonarr/digests
Original file line number Diff line number Diff line change
@@ -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
9 changes: 3 additions & 6 deletions spk/sonarr/Makefile
Original file line number Diff line number Diff line change
@@ -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"

Expand All @@ -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
Expand All @@ -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
Expand Down
30 changes: 13 additions & 17 deletions spk/sonarr/src/service-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 ()
Expand All @@ -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.?
Expand All @@ -90,17 +82,21 @@ 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

set_unix_permissions "${CONFIG_DIR}"

# 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
Expand Down
7 changes: 6 additions & 1 deletion spk/sonarr/src/wizard/upgrade_uifile
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
[{
"step_title": "RECOMMENDATION: Download A Backup Before Upgrading",
"items": [{
"desc": "<strong style='color:red'>IMPORTANT:</strong> This update is an upgrade to Sonarr v3. We suggest that you download a manual backup as a precautionary measure before installing this update.<br><br>You can download a backup via Sonarr's built-in web-interface.<br>To do this, navigate to <b>System>Backup</b> in the Sonarr UI.<br><br>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.<br>Navigate to System>Updates in the Sonarr UI."
"desc": "Keep Sonarr up-to-date by using Sonarr's built-in updater.<br>Navigate to <b>System>Updates</b> in the Sonarr UI."
}]
},{
"step_title": "Attention! DSM Permissions",
Expand Down
7 changes: 6 additions & 1 deletion spk/sonarr/src/wizard/upgrade_uifile_fre
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
[{
"step_title": "RECOMMENDATION: Télécharger une sauvegarde avant la mise à niveau",
"items": [{
"desc": "<strong style='color:red'>IMPORTANT:</strong> 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.<br><br>Vous pouvez télécharger une sauvegarde via l'interface Web intégrée de Sonarr.<br>Pour ce faire, accédez à <b>System>Backup</b> dans l'interface utilisateur Sonarr.<br><br>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 <b>System>Updates</b> dans l'interface Sonarr."
}]
},{
"step_title": "Attention! Permissions DSM",
Expand Down

0 comments on commit 965b404

Please sign in to comment.