diff --git a/ChangeLog.adoc b/ChangeLog.adoc index 27fc8c8ca..6899d18d9 100644 --- a/ChangeLog.adoc +++ b/ChangeLog.adoc @@ -15,6 +15,7 @@ For a list of important changes that require manual actions, please look at rele New features:: + * core: display a message when a configuration file is updated to a newer version * python: make stub (weechat.pyi) compatible with Python 3.8 and 3.9 (issue #2006) Bug fixes:: diff --git a/po/cs.po b/po/cs.po index e19795df9..9cc1892b9 100644 --- a/po/cs.po +++ b/po/cs.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-07-05 21:24+0200\n" +"POT-Creation-Date: 2023-09-11 09:32+0200\n" "PO-Revision-Date: 2023-06-25 00:48+0200\n" "Last-Translator: Ondřej Súkup \n" "Language-Team: weechat-dev \n" @@ -4427,6 +4427,12 @@ msgstr "%sChyba: nemohu vytvořit soubor \"%s\"" msgid "%sError writing configuration file \"%s\"" msgstr "%sChyba při zápisu konfiguračního souboru \"%s\"" +#, c-format +msgid "" +"%sImportant: file %s has been updated from version %d to %d, it is not " +"compatible and can not be loaded any more with any older version" +msgstr "" + #, c-format msgid "%sWARNING: failed to read configuration file \"%s\" (%s)" msgstr "%sVAROVÁNÍ: selhalo čtení konfiguračního souboru \"%s\" (%s)" diff --git a/po/de.po b/po/de.po index 4bfcea411..86314e5f6 100644 --- a/po/de.po +++ b/po/de.po @@ -26,7 +26,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-07-05 21:24+0200\n" +"POT-Creation-Date: 2023-09-11 09:32+0200\n" "PO-Revision-Date: 2023-07-05 21:25+0200\n" "Last-Translator: Nils Görs \n" "Language-Team: German \n" @@ -5585,6 +5585,12 @@ msgid "%sError writing configuration file \"%s\"" msgstr "" "%sEs ist ein Fehler beim Speichern der Konfigurationsdatei \"%s\" aufgetreten" +#, c-format +msgid "" +"%sImportant: file %s has been updated from version %d to %d, it is not " +"compatible and can not be loaded any more with any older version" +msgstr "" + #, c-format msgid "%sWARNING: failed to read configuration file \"%s\" (%s)" msgstr "%sWARNUNG: Konfigurationsdatei \"%s\" konnte nicht geladen werden (%s)" diff --git a/po/es.po b/po/es.po index fac85576d..9dadcff43 100644 --- a/po/es.po +++ b/po/es.po @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-07-05 21:24+0200\n" +"POT-Creation-Date: 2023-09-11 09:32+0200\n" "PO-Revision-Date: 2023-06-17 11:47+0200\n" "Last-Translator: Santiago Forero \n" "Language-Team: weechat-dev \n" @@ -5052,6 +5052,12 @@ msgstr "%sError: no es posible crear el archivo \"%s\"" msgid "%sError writing configuration file \"%s\"" msgstr "%sError al escribir el archivo de configuración \"%s\"" +#, c-format +msgid "" +"%sImportant: file %s has been updated from version %d to %d, it is not " +"compatible and can not be loaded any more with any older version" +msgstr "" + #, fuzzy, c-format msgid "%sWARNING: failed to read configuration file \"%s\" (%s)" msgstr "Guardando archivo de configuración %s %s" diff --git a/po/fr.po b/po/fr.po index d479d0d9c..8f1b0e96b 100644 --- a/po/fr.po +++ b/po/fr.po @@ -21,8 +21,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-07-05 21:24+0200\n" -"PO-Revision-Date: 2023-07-05 21:25+0200\n" +"POT-Creation-Date: 2023-09-11 09:32+0200\n" +"PO-Revision-Date: 2023-09-11 09:33+0200\n" "Last-Translator: Sébastien Helleu \n" "Language-Team: weechat-dev \n" "Language: fr\n" @@ -5452,6 +5452,14 @@ msgstr "%sImpossible de créer le fichier \"%s\"" msgid "%sError writing configuration file \"%s\"" msgstr "%sErreur d'écriture du fichier de configuration \"%s\"" +#, c-format +msgid "" +"%sImportant: file %s has been updated from version %d to %d, it is not " +"compatible and can not be loaded any more with any older version" +msgstr "" +"%sImportant : le fichier %s a été mis à jour de la version %d à %d, il n'est " +"plus compatible et ne peut plus être chargé avec toute version plus ancienne" + #, c-format msgid "%sWARNING: failed to read configuration file \"%s\" (%s)" msgstr "%sATTENTION : échec de lecture du fichier de configuration \"%s\" (%s)" diff --git a/po/hu.po b/po/hu.po index 18668df0b..7967d8106 100644 --- a/po/hu.po +++ b/po/hu.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-07-05 21:24+0200\n" +"POT-Creation-Date: 2023-09-11 09:32+0200\n" "PO-Revision-Date: 2023-06-17 11:47+0200\n" "Last-Translator: Andras Voroskoi \n" "Language-Team: weechat-dev \n" @@ -3972,6 +3972,12 @@ msgstr "%s nem sikerült a \"%s\" fájlt létrehozni\n" msgid "%sError writing configuration file \"%s\"" msgstr "szerver konfigurációs fájljának újraolvastatása" +#, c-format +msgid "" +"%sImportant: file %s has been updated from version %d to %d, it is not " +"compatible and can not be loaded any more with any older version" +msgstr "" + #, fuzzy, c-format msgid "%sWARNING: failed to read configuration file \"%s\" (%s)" msgstr "beállítások mentése kilépéskor" diff --git a/po/it.po b/po/it.po index 4667fb20e..944611869 100644 --- a/po/it.po +++ b/po/it.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-07-05 21:24+0200\n" +"POT-Creation-Date: 2023-09-11 09:32+0200\n" "PO-Revision-Date: 2023-06-17 11:47+0200\n" "Last-Translator: Esteban I. Ruiz Moreno \n" "Language-Team: weechat-dev \n" @@ -4689,6 +4689,12 @@ msgstr "%sErrore: impossibile creare il file \"%s\"" msgid "%sError writing configuration file \"%s\"" msgstr "%sErrore: impossibile scrivere sul file di configurazione \"%s\"" +#, c-format +msgid "" +"%sImportant: file %s has been updated from version %d to %d, it is not " +"compatible and can not be loaded any more with any older version" +msgstr "" + #, fuzzy, c-format msgid "%sWARNING: failed to read configuration file \"%s\" (%s)" msgstr "Salvataggio del file di configurazione %s %s" diff --git a/po/ja.po b/po/ja.po index 90922bebb..544b57010 100644 --- a/po/ja.po +++ b/po/ja.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-07-05 21:24+0200\n" +"POT-Creation-Date: 2023-09-11 09:32+0200\n" "PO-Revision-Date: 2023-06-17 11:47+0200\n" "Last-Translator: AYANOKOUZI, Ryuunosuke \n" "Language-Team: Japanese \n" "Language-Team: Polish \n" @@ -5731,6 +5731,12 @@ msgstr "%sNie można utworzyć pliku \"%s\"" msgid "%sError writing configuration file \"%s\"" msgstr "%sBłąd podczas zapisu pliku konfiguracyjnego \"%s\"" +#, c-format +msgid "" +"%sImportant: file %s has been updated from version %d to %d, it is not " +"compatible and can not be loaded any more with any older version" +msgstr "" + #, c-format msgid "%sWARNING: failed to read configuration file \"%s\" (%s)" msgstr "%sUWAGA: nie powiódł się odczyt pliku konfiguracyjnego \"%s\" (%s)" diff --git a/po/pt.po b/po/pt.po index fc7827788..4b9d13d69 100644 --- a/po/pt.po +++ b/po/pt.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-07-05 21:24+0200\n" +"POT-Creation-Date: 2023-09-11 09:32+0200\n" "PO-Revision-Date: 2023-06-17 11:47+0200\n" "Last-Translator: Vasco Almeida \n" "Language-Team: Portuguese <>\n" @@ -5324,6 +5324,12 @@ msgstr "%sErro: não é possível criar o ficheiro \"%s\"" msgid "%sError writing configuration file \"%s\"" msgstr "%sErro ao escrever o ficheiro de configuração \"%s\"" +#, c-format +msgid "" +"%sImportant: file %s has been updated from version %d to %d, it is not " +"compatible and can not be loaded any more with any older version" +msgstr "" + #, c-format msgid "%sWARNING: failed to read configuration file \"%s\" (%s)" msgstr "%sAVISO: falha ao ler o ficheiro de configuração \"%s\" (%s)" diff --git a/po/pt_BR.po b/po/pt_BR.po index 740f42c1d..da54190dc 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-07-05 21:24+0200\n" +"POT-Creation-Date: 2023-09-11 09:32+0200\n" "PO-Revision-Date: 2023-06-17 11:47+0200\n" "Last-Translator: Érico Nogueira \n" "Language-Team: weechat-dev \n" @@ -4698,6 +4698,12 @@ msgstr "%sErro: não foi possível criar arquivo \"%s\"" msgid "%sError writing configuration file \"%s\"" msgstr "%sErro escrevendo arquivo de configuração \"%s\"" +#, c-format +msgid "" +"%sImportant: file %s has been updated from version %d to %d, it is not " +"compatible and can not be loaded any more with any older version" +msgstr "" + #, fuzzy, c-format msgid "%sWARNING: failed to read configuration file \"%s\" (%s)" msgstr "Escrevendo arquivo de configurações %s %s" diff --git a/po/ru.po b/po/ru.po index 6e0aa7ede..dd34341e0 100644 --- a/po/ru.po +++ b/po/ru.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-07-05 21:24+0200\n" +"POT-Creation-Date: 2023-09-11 09:32+0200\n" "PO-Revision-Date: 2023-06-17 11:47+0200\n" "Last-Translator: Aleksey V Zapparov AKA ixti \n" "Language-Team: weechat-dev \n" @@ -4000,6 +4000,12 @@ msgstr "%s не могу создать файл \"%s\"\n" msgid "%sError writing configuration file \"%s\"" msgstr "перезагрузить конфигурационный файл сервера" +#, c-format +msgid "" +"%sImportant: file %s has been updated from version %d to %d, it is not " +"compatible and can not be loaded any more with any older version" +msgstr "" + #, fuzzy, c-format msgid "%sWARNING: failed to read configuration file \"%s\" (%s)" msgstr "сохранять конфигурационный файл при выходе" diff --git a/po/sr.po b/po/sr.po index d13591e15..ba48d9805 100644 --- a/po/sr.po +++ b/po/sr.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-07-05 21:24+0200\n" +"POT-Creation-Date: 2023-09-11 09:32+0200\n" "PO-Revision-Date: 2023-06-17 11:47+0200\n" "Last-Translator: Ivan Pešić \n" "Language-Team: weechat-dev \n" @@ -5377,6 +5377,12 @@ msgstr "%sНе може да се креира фајл „%s”" msgid "%sError writing configuration file \"%s\"" msgstr "%sГрешка при уписивању конфигурационог фајла „%s”" +#, c-format +msgid "" +"%sImportant: file %s has been updated from version %d to %d, it is not " +"compatible and can not be loaded any more with any older version" +msgstr "" + #, c-format msgid "%sWARNING: failed to read configuration file \"%s\" (%s)" msgstr "%sУПОЗОРЕЊЕ: није могао да се прочита конфигурациони фајл „%s” (%s)" diff --git a/po/tr.po b/po/tr.po index ea553c741..b0aa6e0c6 100644 --- a/po/tr.po +++ b/po/tr.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-07-05 21:24+0200\n" +"POT-Creation-Date: 2023-09-11 09:32+0200\n" "PO-Revision-Date: 2023-06-17 11:47+0200\n" "Last-Translator: Emir SARI \n" "Language-Team: weechat-dev \n" @@ -5375,6 +5375,12 @@ msgstr "%s\"%s\" dosyası oluşturulamıyor" msgid "%sError writing configuration file \"%s\"" msgstr "%s\"%s\" yapılandırma dosyası yazılırken hata" +#, c-format +msgid "" +"%sImportant: file %s has been updated from version %d to %d, it is not " +"compatible and can not be loaded any more with any older version" +msgstr "" + #, c-format msgid "%sWARNING: failed to read configuration file \"%s\" (%s)" msgstr "%sUYARI: \"%s\" yapılandırma dosyası okunamadı (%s)" diff --git a/po/weechat.pot b/po/weechat.pot index 8ce6562f3..3a5b005d7 100644 --- a/po/weechat.pot +++ b/po/weechat.pot @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-07-05 21:24+0200\n" +"POT-Creation-Date: 2023-09-11 09:32+0200\n" "PO-Revision-Date: 2014-08-16 10:27+0200\n" "Last-Translator: Sébastien Helleu \n" "Language-Team: weechat-dev \n" @@ -3624,6 +3624,12 @@ msgstr "" msgid "%sError writing configuration file \"%s\"" msgstr "" +#, c-format +msgid "" +"%sImportant: file %s has been updated from version %d to %d, it is not " +"compatible and can not be loaded any more with any older version" +msgstr "" + #, c-format msgid "%sWARNING: failed to read configuration file \"%s\" (%s)" msgstr "" diff --git a/src/core/wee-config-file.c b/src/core/wee-config-file.c index 648aafa93..f2dde9891 100644 --- a/src/core/wee-config-file.c +++ b/src/core/wee-config-file.c @@ -3173,6 +3173,10 @@ config_file_parse_version (const char *version) * * Section can be updated only if option and value are NULL (ie if we are * reading a section line like "[section]"). + * + * Integer warning_update_displayed is set to 1 if a warning is displayed, + * when the file is updated to a newer version (then it's not compatible any + * more with previous versions). */ void @@ -3182,7 +3186,8 @@ config_file_update_data_read (struct t_config_file *config_file, const char *value, char **ret_section, char **ret_option, - char **ret_value) + char **ret_value, + int *warning_update_displayed) { struct t_hashtable *data_read, *hashtable; const char *ptr_section, *ptr_option, *ptr_value; @@ -3192,6 +3197,21 @@ config_file_update_data_read (struct t_config_file *config_file, if (config_file->version_read >= config_file->version) return; + if (!*warning_update_displayed + && (config_file->version_read < config_file->version)) + { + gui_chat_printf ( + NULL, + _("%sImportant: file %s has been updated from version %d to %d, " + "it is not compatible and can not be loaded any more with any " + "older version"), + gui_chat_prefix[GUI_CHAT_PREFIX_ERROR], + config_file->filename, + config_file->version_read, + config_file->version); + *warning_update_displayed = 1; + } + /* do nothing if there's no update callback */ if (!config_file->callback_update) return; @@ -3289,6 +3309,7 @@ int config_file_read_internal (struct t_config_file *config_file, int reload) { int filename_length, line_number, rc, length, version; + int warning_update_displayed; char *filename, *section, *option, *value; struct t_config_section *ptr_section; struct t_config_option *ptr_option; @@ -3298,6 +3319,7 @@ config_file_read_internal (struct t_config_file *config_file, int reload) return WEECHAT_CONFIG_READ_FILE_NOT_FOUND; config_file->version_read = 1; + warning_update_displayed = 0; /* build filename */ filename_length = strlen (weechat_config_dir) + strlen (DIR_SEPARATOR) + @@ -3398,7 +3420,8 @@ config_file_read_internal (struct t_config_file *config_file, int reload) { config_file_update_data_read (config_file, section, NULL, NULL, - §ion, NULL, NULL); + §ion, NULL, NULL, + &warning_update_displayed); ptr_section = config_file_search_section (config_file, section); if (!ptr_section) @@ -3515,7 +3538,8 @@ config_file_read_internal (struct t_config_file *config_file, int reload) config_file_update_data_read (config_file, ptr_section->name, option, value, - NULL, &option, &value); + NULL, &option, &value, + &warning_update_displayed); /* option has been ignored by the update callback? */ if (!option || !option[0])