diff --git a/README.md b/README.md index 06dde29..51ffb66 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ It shall NOT be edited by hand. # my_capsule for YunoHost -[![Integration level](https://dash.yunohost.org/integration/my_capsule.svg)](https://dash.yunohost.org/appci/app/my_capsule) ![Working status](https://ci-apps.yunohost.org/ci/badges/my_capsule.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/my_capsule.maintain.svg) +[![Integration level](https://dash.yunohost.org/integration/my_capsule.svg)](https://ci-apps.yunohost.org/ci/apps/my_capsule/) ![Working status](https://ci-apps.yunohost.org/ci/badges/my_capsule.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/my_capsule.maintain.svg) [![Install my_capsule with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=my_capsule) diff --git a/README_es.md b/README_es.md index d8aab2c..1ec6941 100644 --- a/README_es.md +++ b/README_es.md @@ -5,7 +5,7 @@ No se debe editar a mano. # my_capsule para Yunohost -[![Nivel de integración](https://dash.yunohost.org/integration/my_capsule.svg)](https://dash.yunohost.org/appci/app/my_capsule) ![Estado funcional](https://ci-apps.yunohost.org/ci/badges/my_capsule.status.svg) ![Estado En Mantención](https://ci-apps.yunohost.org/ci/badges/my_capsule.maintain.svg) +[![Nivel de integración](https://dash.yunohost.org/integration/my_capsule.svg)](https://ci-apps.yunohost.org/ci/apps/my_capsule/) ![Estado funcional](https://ci-apps.yunohost.org/ci/badges/my_capsule.status.svg) ![Estado En Mantención](https://ci-apps.yunohost.org/ci/badges/my_capsule.maintain.svg) [![Instalar my_capsule con Yunhost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=my_capsule) diff --git a/README_eu.md b/README_eu.md index 7ecb8a2..e4a875d 100644 --- a/README_eu.md +++ b/README_eu.md @@ -5,7 +5,7 @@ EZ editatu eskuz. # my_capsule YunoHost-erako -[![Integrazio maila](https://dash.yunohost.org/integration/my_capsule.svg)](https://dash.yunohost.org/appci/app/my_capsule) ![Funtzionamendu egoera](https://ci-apps.yunohost.org/ci/badges/my_capsule.status.svg) ![Mantentze egoera](https://ci-apps.yunohost.org/ci/badges/my_capsule.maintain.svg) +[![Integrazio maila](https://dash.yunohost.org/integration/my_capsule.svg)](https://ci-apps.yunohost.org/ci/apps/my_capsule/) ![Funtzionamendu egoera](https://ci-apps.yunohost.org/ci/badges/my_capsule.status.svg) ![Mantentze egoera](https://ci-apps.yunohost.org/ci/badges/my_capsule.maintain.svg) [![Instalatu my_capsule YunoHost-ekin](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=my_capsule) diff --git a/README_fr.md b/README_fr.md index d55d84c..a987738 100644 --- a/README_fr.md +++ b/README_fr.md @@ -5,7 +5,7 @@ Il NE doit PAS être modifié à la main. # my_capsule pour YunoHost -[![Niveau d’intégration](https://dash.yunohost.org/integration/my_capsule.svg)](https://dash.yunohost.org/appci/app/my_capsule) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/my_capsule.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/my_capsule.maintain.svg) +[![Niveau d’intégration](https://dash.yunohost.org/integration/my_capsule.svg)](https://ci-apps.yunohost.org/ci/apps/my_capsule/) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/my_capsule.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/my_capsule.maintain.svg) [![Installer my_capsule avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=my_capsule) diff --git a/README_gl.md b/README_gl.md index 6ab58ca..f27006d 100644 --- a/README_gl.md +++ b/README_gl.md @@ -5,7 +5,7 @@ NON debe editarse manualmente. # my_capsule para YunoHost -[![Nivel de integración](https://dash.yunohost.org/integration/my_capsule.svg)](https://dash.yunohost.org/appci/app/my_capsule) ![Estado de funcionamento](https://ci-apps.yunohost.org/ci/badges/my_capsule.status.svg) ![Estado de mantemento](https://ci-apps.yunohost.org/ci/badges/my_capsule.maintain.svg) +[![Nivel de integración](https://dash.yunohost.org/integration/my_capsule.svg)](https://ci-apps.yunohost.org/ci/apps/my_capsule/) ![Estado de funcionamento](https://ci-apps.yunohost.org/ci/badges/my_capsule.status.svg) ![Estado de mantemento](https://ci-apps.yunohost.org/ci/badges/my_capsule.maintain.svg) [![Instalar my_capsule con YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=my_capsule) diff --git a/README_zh_Hans.md b/README_zh_Hans.md index 15ef885..105e52b 100644 --- a/README_zh_Hans.md +++ b/README_zh_Hans.md @@ -5,7 +5,7 @@ # YunoHost 上的 my_capsule -[![集成程度](https://dash.yunohost.org/integration/my_capsule.svg)](https://dash.yunohost.org/appci/app/my_capsule) ![工作状态](https://ci-apps.yunohost.org/ci/badges/my_capsule.status.svg) ![维护状态](https://ci-apps.yunohost.org/ci/badges/my_capsule.maintain.svg) +[![集成程度](https://dash.yunohost.org/integration/my_capsule.svg)](https://ci-apps.yunohost.org/ci/apps/my_capsule/) ![工作状态](https://ci-apps.yunohost.org/ci/badges/my_capsule.status.svg) ![维护状态](https://ci-apps.yunohost.org/ci/badges/my_capsule.maintain.svg) [![使用 YunoHost 安装 my_capsule](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=my_capsule) diff --git a/scripts/install b/scripts/install index 9f552dd..0bdd0e5 100755 --- a/scripts/install +++ b/scripts/install @@ -7,15 +7,15 @@ #================================================= source _common.sh -source ynh_apps source /usr/share/yunohost/helpers #================================================= # CREATE DEDICATED USER #================================================= -ynh_script_progression --message="Installing Gemserv..." -# ynh_install_apps --apps="gemserv" +if ! yunohost app list --output-as json --quiet | jq -e '.apps[] | select(.id == "gemserv")' >/dev/null; then + ynh_die --message="Please install gemserv before installing my_capsule." +fi #================================================= # CREATE DEDICATED USER diff --git a/scripts/remove b/scripts/remove index 17839ab..0cbfd13 100755 --- a/scripts/remove +++ b/scripts/remove @@ -7,7 +7,6 @@ #================================================= source _common.sh -source ynh_apps source /usr/share/yunohost/helpers #================================================= @@ -23,14 +22,6 @@ ynh_remove_fpm_config _ynh_remove_gemserv_config -#================================================= -# REMOVE DEPENDENCIES -#================================================= -ynh_script_progression --message="Removing dependencies..." - -# Remove metapackage and its dependencies -ynh_remove_apps - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/restore b/scripts/restore index c231ed3..913862e 100755 --- a/scripts/restore +++ b/scripts/restore @@ -8,7 +8,6 @@ # Keep this path for calling _common.sh inside the execution's context of backup and restore scripts source ../settings/scripts/_common.sh -source ../settings/scripts/ynh_apps source /usr/share/yunohost/helpers #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 7c2747d..a641760 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -7,7 +7,6 @@ #================================================= source _common.sh -source ynh_apps source /usr/share/yunohost/helpers #================================================= diff --git a/scripts/ynh_apps b/scripts/ynh_apps deleted file mode 100644 index 85b74de..0000000 --- a/scripts/ynh_apps +++ /dev/null @@ -1,113 +0,0 @@ -#!/bin/bash - -# Install others YunoHost apps -# -# usage: ynh_install_apps --apps="appfoo?domain=domain.foo&path=/foo appbar?domain=domain.bar&path=/bar&admin=USER&language=fr&is_public=1&pass?word=pass&port=666" -# | arg: -a, --apps= - apps to install -# -# Requires YunoHost version *.*.* or higher. -ynh_install_apps() { - # Declare an array to define the options of this helper. - local legacy_args=a - local -A args_array=([a]=apps=) - local apps - # Manage arguments with getopts - ynh_handle_getopts_args "$@" - - # Split the list of apps in an array - local apps_list=($(echo $apps | tr " " "\n")) - local apps_dependencies="" - - # For each app - for one_app_and_its_args in "${apps_list[@]}" - do - # Retrieve the name of the app (part before ?) - local one_app=$(cut -d "?" -f1 <<< "$one_app_and_its_args") - [ -z "$one_app" ] && ynh_die --message="You didn't provided a YunoHost app to install" - - yunohost tools update apps - - # Installing or upgrading the app depending if it's installed or not - if ! yunohost app list --output-as json --quiet | jq -e --arg id $one_app '.apps[] | select(.id == $id)' >/dev/null - then - # Retrieve the arguments of the app (part after ?) - local one_argument="" - if [[ "$one_app_and_its_args" == *"?"* ]]; then - one_argument=$(cut -d "?" -f2- <<< "$one_app_and_its_args") - one_argument="--args $one_argument" - fi - - # Install the app with its arguments - yunohost app install $one_app $one_argument - else - # Upgrade the app - yunohost app upgrade $one_app - fi - - if [ ! -z "$apps_dependencies" ] - then - apps_dependencies="$apps_dependencies, $one_app" - else - apps_dependencies="$one_app" - fi - done - - ynh_app_setting_set --app=$app --key=apps_dependencies --value="$apps_dependencies" -} - -# Remove other YunoHost apps -# -# Other YunoHost apps will be removed only if no other apps need them. -# -# usage: ynh_remove_apps -# -# Requires YunoHost version *.*.* or higher. -ynh_remove_apps() { - # Retrieve the apps dependencies of the app - local apps_dependencies=$(ynh_app_setting_get --app=$app --key=apps_dependencies) - ynh_app_setting_delete --app=$app --key=apps_dependencies - - if [ ! -z "$apps_dependencies" ] - then - # Split the list of apps dependencies in an array - local apps_dependencies_list=($(echo $apps_dependencies | tr ", " "\n")) - - # For each apps dependencies - for one_app in "${apps_dependencies_list[@]}" - do - # Retrieve the list of installed apps - local installed_apps_list=$(yunohost app list --output-as json --quiet | jq -r .apps[].id) - local required_by="" - local installed_app_required_by="" - - # For each other installed app - for one_installed_app in $installed_apps_list - do - # Retrieve the other apps dependencies - one_installed_apps_dependencies=$(ynh_app_setting_get --app=$one_installed_app --key=apps_dependencies) - if [ ! -z "$one_installed_apps_dependencies" ] - then - one_installed_apps_dependencies_list=($(echo $one_installed_apps_dependencies | tr ", " "\n")) - - # For each dependency of the other apps - for one_installed_app_dependency in "${one_installed_apps_dependencies_list[@]}" - do - if [[ $one_installed_app_dependency == $one_app ]]; then - required_by="$required_by $one_installed_app" - fi - done - fi - done - - # If $one_app is no more required - if [[ -z "$required_by" ]] - then - # Remove $one_app - ynh_print_info --message="Removing of $one_app" - yunohost app remove $one_app --purge - else - ynh_print_info --message="$one_app was not removed because it's still required by${required_by}" - fi - done - fi -}