From e71dfdc17366bb88f1fc05a90e99ab1b4ba31ba1 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Tue, 3 Nov 2020 16:09:07 +0100 Subject: [PATCH] Don't use backport anymore (the app is in main source list now) --- README.md | 2 +- README_fr.md | 2 +- actions.toml | 8 ----- check_process | 20 +++--------- manifest.json | 12 +------ scripts/actions/install_backports | 54 ------------------------------- scripts/actions/install_standard | 47 --------------------------- scripts/backup | 11 ------- scripts/install | 18 +---------- scripts/remove | 3 +- scripts/restore | 15 +-------- scripts/upgrade | 20 ++++-------- 12 files changed, 17 insertions(+), 195 deletions(-) delete mode 100755 scripts/actions/install_backports delete mode 100755 scripts/actions/install_standard diff --git a/README.md b/README.md index fd56407..5720777 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to MiniDLNA is a simple media server software, with the aim of being fully compliant with DLNA/UPnP-AV clients. -**Shipped version:** Debian repositories versions. Currently 1.1.6 and 1.2.1 +**Shipped version:** Debian repositories versions. Currently 1.2.1 ## Screenshots diff --git a/README_fr.md b/README_fr.md index f048bd1..0e28f56 100644 --- a/README_fr.md +++ b/README_fr.md @@ -12,7 +12,7 @@ Si vous n'avez pas YunoHost, merci de regarder [ici](https://yunohost.org/#/inst MiniDLNA est un simple serveur multimédia, dont le but est d'être entièrement compatible avec les clients DLNA/UPnP-AV. -**Version embarquée :** Versions des dépôts Debian. Actuellement 1.1.6 et 1.2.1 +**Version embarquée :** Versions des dépôts Debian. Actuellement 1.2.1 ## Captures d'écran diff --git a/actions.toml b/actions.toml index b5f7183..a051a56 100644 --- a/actions.toml +++ b/actions.toml @@ -1,11 +1,3 @@ -[install_standard] -name = "Install the version from stable repository" -command = "/bin/bash scripts/actions/install_standard" - -[install_backports] -name = "Install the version from backports repository" -command = "/bin/bash scripts/actions/install_backports" - [reset_db] name = "Reinitialise the database" command = "/bin/bash scripts/actions/reset_db" diff --git a/check_process b/check_process index 8daa3b8..77a82b6 100644 --- a/check_process +++ b/check_process @@ -1,6 +1,4 @@ ;; Test paquet stable - ; Manifest - version="A. Version of the Debian repositories - recommended" ; Checks pkg_linter=1 setup_sub_dir=0 @@ -10,24 +8,11 @@ setup_public=0 upgrade=1 upgrade=1 from_commit=2c107b09144c9829be5cc94b202d0f766b2a0db4 + upgrade=1 from_commit=7fa6b0a84e0cb24cd5a26d2f5d64f68875862f42 backup_restore=1 multi_instance=0 port_already_use=1 (48200) change_url=0 -;; Test paquet backports - ; Manifest - version="B. Latest version available for Debian" - ; Checks - setup_sub_dir=0 - setup_root=0 - setup_nourl=1 - setup_private=0 - setup_public=0 - upgrade=1 - backup_restore=0 - multi_instance=0 - port_already_use=0 - change_url=0 ;;; Levels Level 5=auto ;;; Options @@ -37,3 +22,6 @@ Notification=down ; commit=2c107b09144c9829be5cc94b202d0f766b2a0db4 name=01 May 2017 2c107b09144c9829be5cc94b202d0f766b2a0db4 manifest_arg=version=A. Version of the Debian repositories - recommended& + ; commit=7fa6b0a84e0cb24cd5a26d2f5d64f68875862f42 + name=20 Jun 2019 7fa6b0a84e0cb24cd5a26d2f5d64f68875862f42 + manifest_arg=version=B. Latest version available for Debian& diff --git a/manifest.json b/manifest.json index 2680500..b41b0ce 100644 --- a/manifest.json +++ b/manifest.json @@ -23,16 +23,6 @@ "multi_instance": false, "services": [], "arguments": { - "install" : [ - { - "name": "version", - "ask": { - "en": "Select the MiniDLNA version to install", - "fr": "Choix de la version de MiniDLNA à installer" - }, - "choices": ["A. Version of the Debian repositories - recommended", "B. Latest version available for Debian"], - "default": "A. Version of the Debian repositories - recommended" - } - ] + "install" : [] } } diff --git a/scripts/actions/install_backports b/scripts/actions/install_backports deleted file mode 100755 index 9eb9ae3..0000000 --- a/scripts/actions/install_backports +++ /dev/null @@ -1,54 +0,0 @@ -#!/bin/bash - -#================================================= -# GENERIC STARTING -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - -source scripts/_common.sh -source /usr/share/yunohost/helpers - -#================================================= -# RETRIEVE ARGUMENTS -#================================================= - -app=${YNH_APP_INSTANCE_NAME:-$YNH_APP_ID} - -#================================================= -# CHECK IF ARGUMENTS ARE CORRECT -#================================================= - -#================================================= -# CHECK IF AN ACTION HAS TO BE DONE -#================================================= - -if [ -e /etc/apt/sources.list.d/minidlna.list ] -then - ynh_die --message="You are already using the version from backports repository." --ret_code=0 -fi - -#================================================= -# SPECIFIC ACTION -#================================================= -# RE-INSTALL MINIDLNA FROM BACKPORTS -#================================================= -ynh_script_progression --message="Re-installing MiniDLNA from backports..." --weight=9 - -# Remove the current version of minidlna -ynh_package_remove minidlna - -# Then install the version from backports -codename=$(ynh_get_debian_release) -test -z "$codename" && (ynh_die --message="codename empty") - -ynh_replace_string --match_string="__CODENAME__" --replace_string="$codename" --target_file=/etc/yunohost/apps/$app/conf/minidlna.list -cp -a /etc/yunohost/apps/$app/conf/minidlna.list /etc/apt/sources.list.d/ -ynh_apt update -ynh_package_install -t $codename-backports minidlna - -#================================================= -# END OF SCRIPT -#================================================= - -ynh_script_progression --message="Execution completed" --last diff --git a/scripts/actions/install_standard b/scripts/actions/install_standard deleted file mode 100755 index 76f34e6..0000000 --- a/scripts/actions/install_standard +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash - -#================================================= -# GENERIC STARTING -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - -source scripts/_common.sh -source /usr/share/yunohost/helpers - -#================================================= -# RETRIEVE ARGUMENTS -#================================================= - -#================================================= -# CHECK IF ARGUMENTS ARE CORRECT -#================================================= - -#================================================= -# CHECK IF AN ACTION HAS TO BE DONE -#================================================= - -if [ ! -e /etc/apt/sources.list.d/minidlna.list ] -then - ynh_die --message="You are already using the version from the stable repository." --ret_code=0 -fi - -#================================================= -# SPECIFIC ACTION -#================================================= -# RE-INSTALL MINIDLNA FROM STABLE -#================================================= -ynh_script_progression --message="Re-installing MiniDLNA from stable..." --weight=9 - -# Remove the current version of minidlna -ynh_package_remove minidlna -ynh_secure_remove --file="/etc/apt/sources.list.d/minidlna.list" - -ynh_apt update -ynh_package_install minidlna - -#================================================= -# END OF SCRIPT -#================================================= - -ynh_script_progression --message="Execution completed" --last diff --git a/scripts/backup b/scripts/backup index fc4e649..c13a19f 100644 --- a/scripts/backup +++ b/scripts/backup @@ -23,22 +23,11 @@ ynh_print_info --message="Loading installation settings..." app=$YNH_APP_INSTANCE_NAME -version=$(ynh_app_setting_get --app=$app --key=version) - #================================================= # DECLARE DATA AND CONF FILES TO BACKUP #================================================= ynh_print_info --message="Declaring files to be backed up..." -#================================================= -# BACKUP OF THE APT SOURCE -#================================================= - -if [ $version = "B" ] -then - ynh_backup --src_path="/etc/apt/sources.list.d/minidlna.list" -fi - #================================================= # BACKUP OF INOTIFY'S CONFIG #================================================= diff --git a/scripts/install b/scripts/install index 31cc6a6..706063f 100644 --- a/scripts/install +++ b/scripts/install @@ -20,8 +20,6 @@ ynh_abort_if_errors # RETRIEVE ARGUMENTS FROM THE MANIFEST #================================================= -version="$YNH_APP_ARG_VERSION" - app=$YNH_APP_INSTANCE_NAME #================================================= @@ -29,8 +27,6 @@ app=$YNH_APP_INSTANCE_NAME #================================================= ynh_script_progression --message="Storing installation settings..." --weight=2 -ynh_app_setting_set --app=$app --key=version --value=${version:0:1} - ynh_app_setting_set --app=$app --key=overwrite_settings --value=1 ynh_app_setting_set --app=$app --key=admin_mail_html --value=1 @@ -72,19 +68,7 @@ ynh_multimedia_build_main_dir #================================================= ynh_script_progression --message="Installing MiniDLNA..." --weight=45 -if [ ${version:0:1} = "B" ] -then - # Install the backport version. (If you have issues with the standard version from the stable repository) - ynh_replace_string --match_string="__CODENAME__" --replace_string="$codename" --target_file=../conf/minidlna.list - cp -a ../conf/minidlna.list /etc/apt/sources.list.d/ - ynh_apt update - ynh_package_install -t $codename-backports minidlna -else - # Install the standard version from debian repository - ynh_apt update - ynh_package_install minidlna -fi -ynh_app_setting_set --app=$app --key=version --value=${version:0:1} +ynh_add_app_dependencies --package=minidlna #================================================= # INCREASE INOTIFY'S LIMITS diff --git a/scripts/remove b/scripts/remove index 83788a3..8281d88 100755 --- a/scripts/remove +++ b/scripts/remove @@ -46,8 +46,7 @@ ynh_exec_fully_quiet yunohost firewall disallow UDP 1900 #================================================= ynh_script_progression --message="Removing MiniDLNA..." --weight=6 -ynh_apt purge minidlna -ynh_secure_remove --file="/etc/apt/sources.list.d/minidlna.list" +ynh_remove_app_dependencies #================================================= # REMOVE INOTIFY'S CONFIG diff --git a/scripts/restore b/scripts/restore index b66e321..816f3d3 100644 --- a/scripts/restore +++ b/scripts/restore @@ -23,7 +23,6 @@ ynh_script_progression --message="Loading settings..." app=$YNH_APP_INSTANCE_NAME -version=$(ynh_app_setting_get --app=$app --key=version) port=$(ynh_app_setting_get --app=$app --key=port) #================================================= @@ -49,19 +48,7 @@ ynh_multimedia_build_main_dir #================================================= ynh_script_progression --message="Installing MiniDLNA" --weight=45 -if [ ${version:0:1} = "B" ] -then - # Install the backport version. (If you have issues with the standard version from the stable repository) - codename=$(ynh_get_debian_release) - ynh_restore_file --origin_path="/etc/apt/sources.list.d/minidlna.list" - ynh_replace_string --match_string=" [a-z]*-backports" --replace_string=" $codename-backports" --target_file=/etc/apt/sources.list.d/minidlna.list - ynh_apt update - ynh_package_install -t $codename-backports minidlna -else - # Install the standard version from debian repository - ynh_apt update - ynh_package_install minidlna -fi +ynh_add_app_dependencies --package=minidlna #================================================= # RESTORE INOTIFY'S CONFIG diff --git a/scripts/upgrade b/scripts/upgrade index 11e11cc..2056fb9 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -51,6 +51,12 @@ if [ -z "$friendly_name" ]; then ynh_app_setting_set --app=$app --key=friendly_name --value=$friendly_name fi +# If version exists, remove the backport source list, as it's no longer used. +if [ -n "$version" ]; then + ynh_secure_remove --file="/etc/apt/sources.list.d/minidlna.list" + ynh_app_setting_delete --app=$app --key=version +fi + #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= @@ -77,19 +83,7 @@ ynh_multimedia_build_main_dir #================================================= ynh_script_progression --message="Upgrading MiniDLNA..." --weight=3 -if [ $version = "B" ] -then - # Install the backport version. (If you have issues with the standard version from the stable repository) - codename=$(ynh_get_debian_release) - ynh_replace_string --match_string="__CODENAME__" --replace_string="$codename" --target_file=../conf/minidlna.list - cp -a ../conf/minidlna.list /etc/apt/sources.list.d/ - ynh_apt update - ynh_package_install -t $codename-backports minidlna -else - # Install the standard version from debian repository - ynh_apt update - ynh_package_install minidlna -fi +ynh_add_app_dependencies --package=minidlna #================================================= # INCREASE INOTIFY'S LIMITS