From 4e13fb8bd84cd9fbdfacc066c34d15fdca922267 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 29 Jan 2022 03:49:58 +0100 Subject: [PATCH] Fix Unable to locate package (> --- README_fr.md | 14 +++++++------- scripts/install | 6 +++--- scripts/upgrade | 10 +++++----- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/README_fr.md b/README_fr.md index 0be50e3..99e55bf 100644 --- a/README_fr.md +++ b/README_fr.md @@ -13,9 +13,9 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour Tableaux de bords de supervision -**Version incluse :** 8.3.3~ynh1 +**Version incluse :** 8.3.3~ynh1 -**Démo :** https://play.grafana.org +**Démo :** https://play.grafana.org ## Captures d'écran @@ -61,10 +61,10 @@ LDAP and HTTP auth are supported. ## Documentations et ressources -* Site officiel de l'app : https://grafana.com/ -* Dépôt de code officiel de l'app : https://github.com/grafana/ -* Documentation YunoHost pour cette app : https://yunohost.org/app_grafana -* Signaler un bug : https://github.com/YunoHost-Apps/grafana_ynh/issues +* Site officiel de l'app : https://grafana.com/ +* Dépôt de code officiel de l'app : https://github.com/grafana/ +* Documentation YunoHost pour cette app : https://yunohost.org/app_grafana +* Signaler un bug : https://github.com/YunoHost-Apps/grafana_ynh/issues ## Informations pour les développeurs @@ -77,4 +77,4 @@ ou sudo yunohost app upgrade grafana -u https://github.com/YunoHost-Apps/grafana_ynh/tree/testing --debug ``` -**Plus d'infos sur le packaging d'applications :** https://yunohost.org/packaging_apps \ No newline at end of file +**Plus d'infos sur le packaging d'applications :** https://yunohost.org/packaging_apps \ No newline at end of file diff --git a/scripts/install b/scripts/install index bfb6ab7..50d6846 100644 --- a/scripts/install +++ b/scripts/install @@ -185,15 +185,15 @@ ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name <<< # Import default dashboard for NetData (source: https://grafana.com/grafana/dashboards/2701) # Remove new lines tr -d '\n' < ../conf/netdata_dashboard.json > dashboard.json -# Fill the template with the defined data source +# Fill the template with the defined data source sed -i 's/${DS_CENTCOM-INFLUXDB}/InfluxDB/g' dashboard.json # Escape the dashboard definition for MySQL query (source: https://stackoverflow.com/a/4383994) dashboard=$(cat dashboard.json) printf -v escaped_dashboard "%q" "$dashboard" -# Import dashboard into MySQL +# Import dashboard into MySQL ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name <<< "INSERT INTO dashboard (id, version, slug, title, data, org_id, created, updated, uid) VALUES (99999, 0, 'NetData', 'NetData', \"$escaped_dashboard\", 1, '2020-05-16 14:36:50', '2020-05-16 14:36:50', 'yunohost');" -# Add dashboard version +# Add dashboard version ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name <<< "INSERT INTO dashboard_version (id, dashboard_id, parent_version, restored_from, version, created, created_by, message, data) VALUES (99999, 99999, 0, 0, 1, '2020-05-16 14:36:50', 1, 'YunoHost installer', \"$escaped_dashboard\");" # Enable the systemd service so that InfluxDB and Grafana start at boot diff --git a/scripts/upgrade b/scripts/upgrade index 29cb6a9..e9588b7 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -39,7 +39,7 @@ ynh_script_progression --message="Backing up the app before upgrading (may take # Backup the current version of the app ynh_backup_before_upgrade ynh_clean_setup () { - ynh_clean_check_starting + ynh_clean_check_starting # Restore it if the upgrade fails ynh_restore_upgradebackup } @@ -66,7 +66,7 @@ if ynh_legacy_permissions_exists; then ynh_app_setting_delete --app=$app --key=is_public fi -# Migration: remove old repository if defined +# Migration: remove old repository if defined if [ -f "/etc/apt/sources.list.d/grafana_stable.list" ] ; then ynh_secure_remove --file="/etc/apt/sources.list.d/grafana_stable.list" fi @@ -85,7 +85,7 @@ ynh_add_nginx_config ynh_script_progression --message="Upgrading dependencies..." --weight=12 ynh_install_app_dependencies $pkg_dependencies -ynh_install_extra_app_dependencies --repo="deb https://packages.grafana.com/oss/deb stable main" --package="grafana (>=$GRAFANA_VERSION)" --key="https://packages.grafana.com/gpg.key" +ynh_install_extra_app_dependencies --repo="deb https://packages.grafana.com/oss/deb stable main" --package="grafana" --key="https://packages.grafana.com/gpg.key" #================================================= # SPECIFIC UPGRADE @@ -145,12 +145,12 @@ fi # Update default dashboard for NetData (source: https://grafana.com/grafana/dashboards/2701) # Remove new lines tr -d '\n' < ../conf/netdata_dashboard.json > dashboard.json -# Fill the template with the defined data source +# Fill the template with the defined data source sed -i 's/${DS_CENTCOM-INFLUXDB}/InfluxDB/g' dashboard.json # Escape the dashboard definition for MySQL query dashboard=$(cat dashboard.json) printf -v escaped_dashboard "%q" "$dashboard" -# Import dashboard into MySQL +# Import dashboard into MySQL ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name <<< "UPDATE dashboard set data=\"$escaped_dashboard\" WHERE id=99999;" # Insert dashboard version if non existent (for downward compatibility) ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name <<< "INSERT INTO dashboard_version (id, dashboard_id, parent_version, restored_from, version, created, created_by, message, data) VALUES (99999, 99999, 0, 0, 1, '2020-05-16 14:36:50', 1, 'YunoHost installer', \"$escaped_dashboard\");" > /dev/null 2>&1 || true