From c267cb589e4862328891af0ffb955875fb0f006e Mon Sep 17 00:00:00 2001 From: anmol Date: Fri, 13 Nov 2020 05:44:46 +0530 Subject: [PATCH] Check version fix in upgrade script --- README.md | 3 ++- scripts/upgrade | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 244a742e..67b74d03 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,8 @@ # Hubzilla for YunoHost [![Integration level](https://dash.yunohost.org/integration/hubzilla.svg)](https://dash.yunohost.org/appci/app/hubzilla) ![](https://ci-apps.yunohost.org/ci/badges/hubzilla.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/hubzilla.maintain.svg) -[![Install Nextcloud with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=hubzilla) + +[![Install Hubzilla with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=hubzilla) > *This package allow you to install Hubzilla quickly and simply on a YunoHost server. If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to know how to install and enjoy it.* diff --git a/scripts/upgrade b/scripts/upgrade index ffbc0a53..64b3b711 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -160,17 +160,19 @@ if [ $database -eq 1 ]; then # Check version and if this version was a fresh install push mysq query db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) - if [ -z "$last_update" ] && [ "$version" == "3.8.4" ]; then + is_version_equal_three_eight_four=$(awk 'BEGIN{ print "'$version'"<"'3.8.4'" }') + if [ -z "$last_update" ] && [ "$is_version_equal_three_eight_four" -eq 1 ]; then ynh_mysql_connect_as "$db_name" "$db_pwd" "$db_name" < "../conf/sql/385.sql" fi elif [ $database -eq 2 ]; then ynh_install_app_dependencies $pkg_dependencies fi +is_version_less_then_five=$(awk 'BEGIN{ print "'$version'"<"'5.0.0'" }') -if [ -z "$last_update" ] && [ $version -lt 5.0.0 ] && [ $version -nt 5.0.0 ] && [ -f "$final_path/util/z6convert.php" ] ; then +if [ "$is_version_less_then_five" -eq 1 ] && [ -f "$final_path/util/z6convert.php" ] ; then pushd "$final_path" - php${YNH_PHP_VERSION} util/z6convert.php + php${YNH_PHP_VERSION} util/z6convert.php popd fi