mirror of
https://github.com/weechat/weechat.git
synced 2026-07-05 01:03:14 +02:00
core: auto disable upgrade process (command line option "--upgrade") if the file weechat.upgrade is not found
This commit is contained in:
@@ -290,7 +290,6 @@ plugin_get_args (struct t_weechat_plugin *plugin,
|
||||
|| (strcmp (argv[i], "--no-connect") == 0)
|
||||
|| (strcmp (argv[i], "-s") == 0)
|
||||
|| (strcmp (argv[i], "--no-script") == 0)
|
||||
|| (strcmp (argv[i], "--upgrade") == 0)
|
||||
|| (strncmp (argv[i], plugin->name,
|
||||
strlen (plugin->name)) == 0))
|
||||
{
|
||||
@@ -572,6 +571,7 @@ plugin_load (const char *filename, int init_plugin, int argc, char **argv)
|
||||
new_plugin->initialized = 0;
|
||||
ptr_option = config_weechat_debug_get (name);
|
||||
new_plugin->debug = (ptr_option) ? CONFIG_INTEGER(ptr_option) : 0;
|
||||
new_plugin->upgrading = weechat_upgrading;
|
||||
new_plugin->variables = hashtable_new (
|
||||
32,
|
||||
WEECHAT_HASHTABLE_STRING, WEECHAT_HASHTABLE_STRING,
|
||||
@@ -1402,6 +1402,7 @@ plugin_hdata_plugin_cb (const void *pointer, void *data,
|
||||
HDATA_VAR(struct t_weechat_plugin, priority, INTEGER, 0, NULL, NULL);
|
||||
HDATA_VAR(struct t_weechat_plugin, initialized, INTEGER, 0, NULL, NULL);
|
||||
HDATA_VAR(struct t_weechat_plugin, debug, INTEGER, 0, NULL, NULL);
|
||||
HDATA_VAR(struct t_weechat_plugin, upgrading, INTEGER, 0, NULL, NULL);
|
||||
HDATA_VAR(struct t_weechat_plugin, variables, HASHTABLE, 0, NULL, NULL);
|
||||
HDATA_VAR(struct t_weechat_plugin, prev_plugin, POINTER, 0, NULL, hdata_name);
|
||||
HDATA_VAR(struct t_weechat_plugin, next_plugin, POINTER, 0, NULL, hdata_name);
|
||||
@@ -1460,6 +1461,8 @@ plugin_add_to_infolist (struct t_infolist *infolist,
|
||||
return 0;
|
||||
if (!infolist_new_var_integer (ptr_item, "debug", plugin->debug))
|
||||
return 0;
|
||||
if (!infolist_new_var_integer (ptr_item, "upgrading", plugin->upgrading))
|
||||
return 0;
|
||||
if (!hashtable_add_to_infolist (plugin->variables, ptr_item, "var"))
|
||||
return 0;
|
||||
|
||||
@@ -1491,6 +1494,7 @@ plugin_print_log ()
|
||||
log_printf (" priority . . . . . . . : %d", ptr_plugin->priority);
|
||||
log_printf (" initialized. . . . . . : %d", ptr_plugin->initialized);
|
||||
log_printf (" debug. . . . . . . . . : %d", ptr_plugin->debug);
|
||||
log_printf (" upgrading. . . . . . . : %d", ptr_plugin->upgrading);
|
||||
hashtable_print_log (ptr_plugin->variables, "variables");
|
||||
log_printf (" prev_plugin. . . . . . : 0x%lx", ptr_plugin->prev_plugin);
|
||||
log_printf (" next_plugin. . . . . . : 0x%lx", ptr_plugin->next_plugin);
|
||||
|
||||
Reference in New Issue
Block a user