From 38dd4d0884e888222078f275b948d2ab24e870b9 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Wed, 1 Jul 2020 17:36:52 +0200 Subject: [PATCH 1/2] Use ynh_install_extra_app_dep to manage the custom source.list --- manifest.json | 20 +++++++++----------- scripts/install | 13 +++---------- scripts/restore | 12 ++---------- scripts/upgrade | 13 +++---------- 4 files changed, 17 insertions(+), 41 deletions(-) diff --git a/manifest.json b/manifest.json index d0b2743..e311c92 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "A LibreOffice-based online office suite with collaborative editing", "fr": "Une suite office en ligne et collaborative, basée sur LibreOffice" }, - "version": "4.0.0~ynh1", + "version": "4.0.0~ynh2", "url": "https://www.libreoffice.org/download/libreoffice-online/", "license": "MPL-2.0", "maintainer": { @@ -15,7 +15,7 @@ "url": "https://collaboraoffice.com" }, "requirements": { - "yunohost": ">= 3.5" + "yunohost": ">= 3.8.1" }, "multi_instance": false, "services": [ @@ -32,9 +32,7 @@ }, "example": "example.com" }, - - - { + { "name": "password", "type": "password", "ask": { @@ -42,9 +40,9 @@ "fr": "Choisissez un mot de passe pour l'administration de Collabora" }, "example": "password" - + }, - { + { "name": "nextcloud_domain", "type": "string", "ask": { @@ -53,10 +51,10 @@ }, "example": "example.com", "default": "" - - } - - + + } + + ] } } diff --git a/scripts/install b/scripts/install index 3fe4456..07cb2d9 100644 --- a/scripts/install +++ b/scripts/install @@ -63,18 +63,11 @@ ynh_app_setting_set --app=$app --key=port --value=$port #=============================================== # ADD COLLABORA REPOSITORY #=============================================== -ynh_print_info --message="Add Collabora repository..." - -apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0C54D189F4BA284D -DEBIAN_VERSION_NUMBER=$(cat /etc/debian_version | head -n 1 | cut -f1 -d .) -echo "deb https://collaboraoffice.com/repos/CollaboraOnline/CODE-debian${DEBIAN_VERSION_NUMBER} ./" | tee -a /etc/apt/sources.list.d/collabora.list - -#================================================= -# INSTALL DEPENDENCIES -#================================================= ynh_print_info --message="Installing dependencies..." -ynh_install_app_dependencies $pkg_dependencies +DEBIAN_VERSION_NUMBER=$(cat /etc/debian_version | head -n 1 | cut -f1 -d .) + +ynh_install_extra_app_dependencies --repo="deb https://collaboraoffice.com/repos/CollaboraOnline/CODE-debian${DEBIAN_VERSION_NUMBER} ./" --package="$pkg_dependencies" --key="https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x0C54D189F4BA284D" #================================================= # NGINX CONFIGURATION diff --git a/scripts/restore b/scripts/restore index acd3a7d..ff44705 100644 --- a/scripts/restore +++ b/scripts/restore @@ -51,19 +51,11 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" #=============================================== # ADD COLLABORA REPOSITORY #=============================================== -ynh_print_info --message="Add Collabora repository..." +ynh_print_info --message="Installing dependencies..." -apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0C54D189F4BA284D DEBIAN_VERSION_NUMBER=$(cat /etc/debian_version | head -n 1 | cut -f1 -d .) -echo "deb https://collaboraoffice.com/repos/CollaboraOnline/CODE-debian${DEBIAN_VERSION_NUMBER} ./" | tee -a /etc/apt/sources.list.d/collabora.list -#================================================= -# REINSTALL DEPENDENCIES -#================================================= -ynh_print_info --message="Reinstalling dependencies..." - -# Define and install dependencies -ynh_install_app_dependencies $pkg_dependencies +ynh_install_extra_app_dependencies --repo="deb https://collaboraoffice.com/repos/CollaboraOnline/CODE-debian${DEBIAN_VERSION_NUMBER} ./" --package="$pkg_dependencies" --key="https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x0C54D189F4BA284D" #================================================= # RESTORE CONFIGURATION diff --git a/scripts/upgrade b/scripts/upgrade index 7dd9116..38d52a8 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -74,21 +74,14 @@ ynh_print_info --message="Upgrading nginx web server configuration..." # Create a dedicated nginx config ynh_add_nginx_config -#=============================================== -# ADD COLLABORA REPOSITORY -#=============================================== -ynh_print_info --message="Add Collabora repository..." - -apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0C54D189F4BA284D -DEBIAN_VERSION_NUMBER=$(cat /etc/debian_version | head -n 1 | cut -f1 -d .) -echo "deb https://collaboraoffice.com/repos/CollaboraOnline/CODE-debian${DEBIAN_VERSION_NUMBER} ./" | tee -a /etc/apt/sources.list.d/collabora.list - #================================================= # UPGRADE DEPENDENCIES #================================================= ynh_print_info --message="Upgrading dependencies..." -ynh_install_app_dependencies $pkg_dependencies +DEBIAN_VERSION_NUMBER=$(cat /etc/debian_version | head -n 1 | cut -f1 -d .) + +ynh_install_extra_app_dependencies --repo="deb https://collaboraoffice.com/repos/CollaboraOnline/CODE-debian${DEBIAN_VERSION_NUMBER} ./" --package="$pkg_dependencies" --key="https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x0C54D189F4BA284D" #================================================= # SPECIFIC UPGRADE From e2a758b9b8b192e8d3c29d4dbe07969001a2b9ed Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Wed, 1 Jul 2020 18:16:38 +0200 Subject: [PATCH 2/2] Stupid workaround for bug happening where there's no component in repo --- scripts/install | 2 +- scripts/restore | 2 +- scripts/upgrade | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index 07cb2d9..4bb1f2e 100644 --- a/scripts/install +++ b/scripts/install @@ -67,7 +67,7 @@ ynh_print_info --message="Installing dependencies..." DEBIAN_VERSION_NUMBER=$(cat /etc/debian_version | head -n 1 | cut -f1 -d .) -ynh_install_extra_app_dependencies --repo="deb https://collaboraoffice.com/repos/CollaboraOnline/CODE-debian${DEBIAN_VERSION_NUMBER} ./" --package="$pkg_dependencies" --key="https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x0C54D189F4BA284D" +ynh_install_extra_app_dependencies --repo="deb https://collaboraoffice.com/repos/CollaboraOnline/CODE-debian${DEBIAN_VERSION_NUMBER} ./ " --package="$pkg_dependencies" --key="https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x0C54D189F4BA284D" #================================================= # NGINX CONFIGURATION diff --git a/scripts/restore b/scripts/restore index ff44705..48809c7 100644 --- a/scripts/restore +++ b/scripts/restore @@ -55,7 +55,7 @@ ynh_print_info --message="Installing dependencies..." DEBIAN_VERSION_NUMBER=$(cat /etc/debian_version | head -n 1 | cut -f1 -d .) -ynh_install_extra_app_dependencies --repo="deb https://collaboraoffice.com/repos/CollaboraOnline/CODE-debian${DEBIAN_VERSION_NUMBER} ./" --package="$pkg_dependencies" --key="https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x0C54D189F4BA284D" +ynh_install_extra_app_dependencies --repo="deb https://collaboraoffice.com/repos/CollaboraOnline/CODE-debian${DEBIAN_VERSION_NUMBER} ./ " --package="$pkg_dependencies" --key="https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x0C54D189F4BA284D" #================================================= # RESTORE CONFIGURATION diff --git a/scripts/upgrade b/scripts/upgrade index 38d52a8..91b1b31 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -81,7 +81,7 @@ ynh_print_info --message="Upgrading dependencies..." DEBIAN_VERSION_NUMBER=$(cat /etc/debian_version | head -n 1 | cut -f1 -d .) -ynh_install_extra_app_dependencies --repo="deb https://collaboraoffice.com/repos/CollaboraOnline/CODE-debian${DEBIAN_VERSION_NUMBER} ./" --package="$pkg_dependencies" --key="https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x0C54D189F4BA284D" +ynh_install_extra_app_dependencies --repo="deb https://collaboraoffice.com/repos/CollaboraOnline/CODE-debian${DEBIAN_VERSION_NUMBER} ./ " --package="$pkg_dependencies" --key="https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x0C54D189F4BA284D" #================================================= # SPECIFIC UPGRADE