From a7601be73175b071650d0cb3b7d17898ee9a426f Mon Sep 17 00:00:00 2001 From: ljf Date: Fri, 9 Dec 2022 18:47:56 +0100 Subject: [PATCH 1/2] Upgrade to yakforms --- manifest.json | 8 +++--- scripts/upgrade | 73 ++++++++++++++++++++++++++++++++++++++----------- 2 files changed, 61 insertions(+), 20 deletions(-) diff --git a/manifest.json b/manifest.json index f23a51f..39dba71 100644 --- a/manifest.json +++ b/manifest.json @@ -6,12 +6,12 @@ "en": "Create online webforms and surveys", "fr": "Créez des formulaires et questionnaires en ligne" }, - "version": "1.0.3~ynh3", - "url": "https://framaforms.org", + "version": "1.1~ynh1", + "url": "https://yakforms.org", "upstream": { "license": "GPL-2.0-only", - "website": "https://framaforms.org", - "code": "https://framagit.org/framasoft/framaforms" + "website": "https://yakforms.org", + "code": "https://framagit.org/yakforms/yakforms" }, "license": "GPL-2.0-only", "maintainer": { diff --git a/scripts/upgrade b/scripts/upgrade index ff89d72..96e758a 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -90,21 +90,6 @@ ynh_script_progression --message="Making sure dedicated system user exists..." - # Create a dedicated user (if not existing) ynh_system_user_create --username=$app --home_dir=$final_path -#================================================= -# DOWNLOAD, CHECK AND UNPACK SOURCE -#================================================= - -if [ "$upgrade_type" == "UPGRADE_APP" ] -then - ynh_script_progression --message="Upgrading source files..." --weight=9 - - # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$final_path/app" -fi - -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app:www-data "$final_path" #================================================= # UPGRADE DEPENDENCIES @@ -141,6 +126,45 @@ chmod 750 "$datadir" chmod -R o-rwx "$datadir" chown -R $app:www-data "$datadir" +#================================================= +# Framaforms 2 Yakforms Backup +#================================================= +upgrade_to_yakforms=false +if test -d "$final_path/app/CHANGELOG-FRAMAFORMS.md" +then + update-alternatives --set php /usr/bin/php$phpversion + upgrade_to_yakforms=true + + pushd "$final_path" + ynh_exec_as $app env PATH=$PATH php framaforms2yakforms.php backup + ynh_exec_as $app env PATH=$PATH drush @$app dis framaforms + ynh_exec_as $app env PATH=$PATH drush @$app pm-uninstall framaforms + ynh_exec_as $app env PATH=$PATH drush @$app dis framaforms_share_results + ynh_exec_as $app env PATH=$PATH drush @$app pm-uninstall framaforms_share_results + ynh_exec_as $app env PATH=$PATH drush @$app dis framaforms_public_results + ynh_exec_as $app env PATH=$PATH drush @$app pm-uninstall framaforms_public_results + ynh_exec_as $app env PATH=$PATH drush @$app dis framaforms_spam + ynh_exec_as $app env PATH=$PATH drush @$app pm-uninstall framaforms_spam + popd + update-alternatives --set php /usr/bin/php${YNH_DEFAULT_PHP_VERSION} + +fi +#================================================= +# DOWNLOAD, CHECK AND UNPACK SOURCE +#================================================= + +if [ "$upgrade_type" == "UPGRADE_APP" ] +then + ynh_script_progression --message="Upgrading source files..." --weight=9 + + # Download, check integrity, uncompress and patch the source from app.src + ynh_setup_source --dest_dir="$final_path/app" +fi + +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:www-data "$final_path" + #================================================= # UPGRADE COMPOSER #================================================= @@ -150,10 +174,27 @@ ynh_install_composer --phpversion="$phpversion" --workdir="$final_path/.composer export PATH="$final_path/.composer/vendor/bin:$PATH" +#================================================= +# Framaforms 2 Yakforms Restore +#================================================= +if [ "$upgrade_to_yakforms" = true ] +then + update-alternatives --set php /usr/bin/php$phpversion + + pushd "$final_path" + ynh_exec_as $app env PATH=$PATH drush @$app en yakforms + ynh_exec_as $app env PATH=$PATH drush @$app dis yakforms_share_results + ynh_exec_as $app env PATH=$PATH drush @$app dis yakforms_public_results + ynh_exec_as $app env PATH=$PATH drush @$app dis yakforms_spam + ynh_exec_as $app env PATH=$PATH php framaforms2yakforms.php restore + ynh_exec_as $app env PATH=$PATH php framaforms2yakforms.php clean + popd + update-alternatives --set php /usr/bin/php${YNH_DEFAULT_PHP_VERSION} +fi + #================================================= # UPGRADE DRUPAL #================================================= - if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Upgrading Drupal..." --weight=30 From f7aca490dad53c63b5c55b2d78c2ad7ef9798373 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Fri, 9 Dec 2022 17:49:03 +0000 Subject: [PATCH 2/2] Auto-update README --- README.md | 7 +++---- README_fr.md | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 3aa3708..84046b8 100644 --- a/README.md +++ b/README.md @@ -19,8 +19,7 @@ Framaforms is an online forms and surveys service. Registered users are allowed See this [article](https://framablog.org/2016/10/05/framaforms-noffrez-plus-les-reponses-que-vous-collectez-a-google/) and this [interview](https://framablog.org/2016/10/05/en-savoir-un-peu-plus-sur-le-projet-framaforms/) (in French) for further informations. -**Shipped version:** 1.0.3~ynh3 - +**Shipped version:** 1.1~ynh1 ## Disclaimers / important information ## Configuration @@ -29,8 +28,8 @@ You can modify some configurations using the Framaforms administration panel. Yo ## Documentation and resources -* Official app website: -* Upstream app code repository: +* Official app website: +* Upstream app code repository: * YunoHost documentation for this app: * Report a bug: diff --git a/README_fr.md b/README_fr.md index 5b25d6f..9e1b51b 100644 --- a/README_fr.md +++ b/README_fr.md @@ -19,8 +19,7 @@ Framaforms is an online forms and surveys service. Registered users are allowed See this [article](https://framablog.org/2016/10/05/framaforms-noffrez-plus-les-reponses-que-vous-collectez-a-google/) and this [interview](https://framablog.org/2016/10/05/en-savoir-un-peu-plus-sur-le-projet-framaforms/) (in French) for further informations. -**Version incluse :** 1.0.3~ynh3 - +**Version incluse :** 1.1~ynh1 ## Avertissements / informations importantes ## Configuration @@ -29,8 +28,8 @@ You can modify some configurations using the Framaforms administration panel. Yo ## Documentations et ressources -* Site officiel de l'app : -* Dépôt de code officiel de l'app : +* Site officiel de l'app : +* Dépôt de code officiel de l'app : * Documentation YunoHost pour cette app : * Signaler un bug :