diff --git a/manifest.json b/manifest.json index f9c1114..f65f256 100644 --- a/manifest.json +++ b/manifest.json @@ -7,7 +7,7 @@ "fr": "Forum de nouvelle génération, simplement", "de": "Forum der nächsten Generation leicht gemacht" }, - "version": "1.0.0~ynh6", + "version": "1.1.1~ynh1", "url": "http://flarum.org/", "upstream": { "license": "MIT", diff --git a/scripts/_common.sh b/scripts/_common.sh index ed6c97c..d00fdd1 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -14,8 +14,8 @@ extra_php_dependencies="php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-dom php # Version numbers project_version="~1.0.0" -core_version="~1.0.0" -ldap_version="~1.0.0-p1" +#core_version is now retrieved from the manifest +ldap_version="*" #================================================= # PERSONAL HELPERS diff --git a/scripts/install b/scripts/install index d817c79..53cea4a 100644 --- a/scripts/install +++ b/scripts/install @@ -31,6 +31,7 @@ admin_pwd=$YNH_APP_ARG_PASSWORD is_public=$YNH_APP_ARG_IS_PUBLIC language=$YNH_APP_ARG_LANGUAGE title=$YNH_APP_ARG_TITLE +core_version=$(ynh_app_upstream_version) admin_mail=$(ynh_user_get_info --username=$admin --key=mail) diff --git a/scripts/upgrade b/scripts/upgrade index d10315d..8be6827 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -26,6 +26,7 @@ db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd) old_project_version=$(ynh_app_setting_get --app=$app --key=project_version) old_core_version=$(ynh_app_setting_get --app=$app --key=core_version) +core_version=$(ynh_app_upstream_version) old_ldap_version=$(ynh_app_setting_get --app=$app --key=ldap_version) #================================================= @@ -84,7 +85,7 @@ if [ ! -z "$bazaar_extension" ]; then ynh_app_setting_delete --app=$app --key=bazaar_extension fi -# Remove SSOwat if it exists +# Remove SSOwat extension if it exists ssowat_extension=$(ynh_app_setting_get --app=$app --key=ssowat_extension) if [ ! -z "$ssowat_extension" ]; then ynh_exec_warn_less ynh_composer_exec --phpversion=$phpversion --workdir=$final_path --commands="remove tituspijean/flarum-ext-auth-ssowat" @@ -183,6 +184,12 @@ then # Install Composer and Flarum ynh_exec_warn_less ynh_install_composer --phpversion=$phpversion --workdir=$final_path + if [ ynh_compare_current_package_version --comparison lt --version 1.1.0~ynh1 ]; then + # Starting 1.0 (implemented for 1.1 in the package), version requirement is "*" for extensions + # ... except for flarum/core, but that's handled in the next block. + jq '.require | .[] = "*"' $final_path/composer.json + fi + # Perform migrations and clear cache pushd $final_path ynh_script_progression --message="Upgrading Flarum and its extensions..." --weight=1 @@ -210,14 +217,14 @@ fi case $language in fr) ynh_script_progression --message="Installing French extension..." --weight=2 - ynh_exec_warn_less ynh_composer_exec --phpversion=$phpversion --workdir=$final_path --commands="require qiaeru/lang-french:^2.0.0" + ynh_exec_warn_less ynh_composer_exec --phpversion=$phpversion --workdir=$final_path --commands="require qiaeru/lang-french:*" activate_flarum_extension $db_name "qiaeru-lang-french" sql_command="UPDATE \`settings\` SET \`value\` = 'fr' WHERE \`settings\`.\`key\` = 'default_locale'" ynh_mysql_execute_as_root --sql="$sql_command" --database=$db_name ;; de) ynh_script_progression --message="Installing German extension..." --weight=2 - ynh_exec_warn_less ynh_composer_exec --phpversion=$phpversion --workdir=$final_path --commands="require kakifrucht/flarum-de:^1.0.0" + ynh_exec_warn_less ynh_composer_exec --phpversion=$phpversion --workdir=$final_path --commands="require kakifrucht/flarum-de:*" activate_flarum_extension $db_name "kakifrucht-de" sql_command="UPDATE \`settings\` SET \`value\` = 'de' WHERE \`settings\`.\`key\` = 'default_locale'" ynh_mysql_execute_as_root --sql="$sql_command" --database=$db_name