mirror of
https://github.com/weechat/weechat.git
synced 2026-07-09 11:13:12 +02:00
core, plugins: abort upgrade immediately if any upgrade file fails to be written
Detail of changes: - the save of upgrade files in plugins is now done as soon as the "upgrade" signal is received, and not when the plugin is unloaded (it was too late to detect any problem and prevent the upgrade to happen) - if the write of an upgrade file fails, the signal callback in plugin now returns WEECHAT_RC_ERROR and WeeChat checks this code to stop the upgrade as soon as this return code is received - a new flag is added in plugin structure: unload_with_upgrade, it is set to 1 before unloading all plugins when upgrade will happen (all *.upgrade files are then already successfully written).
This commit is contained in:
@@ -74,7 +74,7 @@ struct t_weelist_item;
|
||||
* please change the date with current one; for a second change at same
|
||||
* date, increment the 01, otherwise please keep 01.
|
||||
*/
|
||||
#define WEECHAT_PLUGIN_API_VERSION "20240727-01"
|
||||
#define WEECHAT_PLUGIN_API_VERSION "20241124-01"
|
||||
|
||||
/* macros for defining plugin infos */
|
||||
#define WEECHAT_PLUGIN_NAME(__name) \
|
||||
@@ -307,6 +307,8 @@ struct t_weechat_plugin
|
||||
int upgrading; /* 1 if the plugin must load upgrade */
|
||||
/* info on startup (if weechat is */
|
||||
/* run with --upgrade) */
|
||||
int unload_with_upgrade; /* 1 if the plugin is unloaded after */
|
||||
/* /upgrade command */
|
||||
struct t_hashtable *variables; /* plugin custom variables */
|
||||
struct t_weechat_plugin *prev_plugin; /* link to previous plugin */
|
||||
struct t_weechat_plugin *next_plugin; /* link to next plugin */
|
||||
|
||||
Reference in New Issue
Block a user