diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2009-04-15 23:46:22 +0200 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2009-04-15 23:46:22 +0200 |
commit | 369d329f4f6be4bee4dd9ab5c3d1498233578259 (patch) | |
tree | 009dd8e1f2461f1946dfaa0b71e793107ed43613 | |
parent | 46dee68d5777f3c84069f5693c426288a7b39f80 (diff) | |
download | weechat-369d329f4f6be4bee4dd9ab5c3d1498233578259.zip |
Remove *.upgrade files in weechat dir after /upgrade
-rw-r--r-- | po/cs.po | 6 | ||||
-rw-r--r-- | po/de.po | 6 | ||||
-rw-r--r-- | po/es.po | 6 | ||||
-rw-r--r-- | po/fr.po | 8 | ||||
-rw-r--r-- | po/hu.po | 6 | ||||
-rw-r--r-- | po/ru.po | 6 | ||||
-rw-r--r-- | po/weechat.pot | 6 | ||||
-rw-r--r-- | src/core/wee-upgrade.c | 32 | ||||
-rw-r--r-- | src/core/wee-upgrade.h | 1 | ||||
-rw-r--r-- | src/core/weechat.c | 2 |
10 files changed, 71 insertions, 8 deletions
@@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.2.7-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2009-04-09 12:57+0200\n" +"POT-Creation-Date: 2009-04-15 23:39+0200\n" "PO-Revision-Date: 2009-01-03 00:42+0100\n" "Last-Translator: Jiri Golembiovsky <golemj@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -1857,6 +1857,10 @@ msgid "byte" msgstr "bajtů" #, fuzzy, c-format +msgid "debug: removing file: %s" +msgstr " IRC(%s)\n" + +#, fuzzy, c-format msgid "%sError upgrading WeeChat with file \"%s\":" msgstr "%s nemohu vytvořit soubor \"%s\"\n" @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.2.7-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2009-04-09 12:57+0200\n" +"POT-Creation-Date: 2009-04-15 23:39+0200\n" "PO-Revision-Date: 2009-01-03 00:42+0100\n" "Last-Translator: Thomas Schuetz <i18n@internet-villa.de>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -1871,6 +1871,10 @@ msgid "byte" msgstr "Bytes" #, fuzzy, c-format +msgid "debug: removing file: %s" +msgstr " IRC(%s)\n" + +#, fuzzy, c-format msgid "%sError upgrading WeeChat with file \"%s\":" msgstr "Aktualisiere WeeChat...\n" @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.2.7-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2009-04-09 12:57+0200\n" +"POT-Creation-Date: 2009-04-15 23:39+0200\n" "PO-Revision-Date: 2009-01-03 00:42+0100\n" "Last-Translator: Roberto González Cardenete <robert.glez@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -1850,6 +1850,10 @@ msgid "byte" msgstr "bytes" #, fuzzy, c-format +msgid "debug: removing file: %s" +msgstr " IRC(%s)\n" + +#, fuzzy, c-format msgid "%sError upgrading WeeChat with file \"%s\":" msgstr "Actualizando Weechat...\n" @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.2.7-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2009-04-09 12:57+0200\n" -"PO-Revision-Date: 2009-04-09 12:58+0200\n" +"POT-Creation-Date: 2009-04-15 23:39+0200\n" +"PO-Revision-Date: 2009-04-15 23:39+0200\n" "Last-Translator: FlashCode <flashcode@flashtux.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" "MIME-Version: 1.0\n" @@ -1959,6 +1959,10 @@ msgid "byte" msgstr "octet" #, c-format +msgid "debug: removing file: %s" +msgstr "debug: suppression du fichier: %s" + +#, c-format msgid "%sError upgrading WeeChat with file \"%s\":" msgstr "%sErreur de mise à jour de WeeChat avec le fichier \"%s\":" @@ -12,7 +12,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.2.7-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2009-04-09 12:57+0200\n" +"POT-Creation-Date: 2009-04-15 23:39+0200\n" "PO-Revision-Date: 2009-01-03 00:42+0100\n" "Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -1882,6 +1882,10 @@ msgid "byte" msgstr "byte" #, fuzzy, c-format +msgid "debug: removing file: %s" +msgstr " IRC(%s)\n" + +#, fuzzy, c-format msgid "%sError upgrading WeeChat with file \"%s\":" msgstr "WeeChat frissítése...\n" @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.2.7-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2009-04-09 12:57+0200\n" +"POT-Creation-Date: 2009-04-15 23:39+0200\n" "PO-Revision-Date: 2009-01-03 00:42+0100\n" "Last-Translator: Pavel Shevchuk <stlwrt@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -1884,6 +1884,10 @@ msgid "byte" msgstr "байтов" #, fuzzy, c-format +msgid "debug: removing file: %s" +msgstr " IRC(%s)\n" + +#, fuzzy, c-format msgid "%sError upgrading WeeChat with file \"%s\":" msgstr "Обновляю WeeChat...\n" diff --git a/po/weechat.pot b/po/weechat.pot index 190b6546a..8da0aea6b 100644 --- a/po/weechat.pot +++ b/po/weechat.pot @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2009-04-09 12:57+0200\n" +"POT-Creation-Date: 2009-04-15 23:39+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -1593,6 +1593,10 @@ msgid "byte" msgstr "" #, c-format +msgid "debug: removing file: %s" +msgstr "" + +#, c-format msgid "%sError upgrading WeeChat with file \"%s\":" msgstr "" diff --git a/src/core/wee-upgrade.c b/src/core/wee-upgrade.c index a99351e1a..849aa927e 100644 --- a/src/core/wee-upgrade.c +++ b/src/core/wee-upgrade.c @@ -24,12 +24,14 @@ #endif #include <stdlib.h> +#include <unistd.h> #include <string.h> #include "weechat.h" #include "wee-upgrade.h" #include "wee-infolist.h" #include "wee-string.h" +#include "wee-util.h" #include "../gui/gui-buffer.h" #include "../gui/gui-chat.h" #include "../gui/gui-history.h" @@ -562,3 +564,33 @@ upgrade_weechat_load () return rc; } + +/* + * upgrade_weechat_remove_file_cb: callback called to remove a .upgrade file + */ + +void +upgrade_weechat_remove_file_cb (void *data, const char *filename) +{ + /* make C compiler happy */ + (void) data; + + if (string_match (filename, "*.upgrade", 1)) + { + if (weechat_debug_core >= 2) + gui_chat_printf (NULL, _("debug: removing file: %s"), filename); + unlink (filename); + } +} + +/* + * upgrade_weechat_remove_files: remove *.upgrade files after upgrade + */ + +void +upgrade_weechat_remove_files () +{ + util_exec_on_files (weechat_home, + NULL, + &upgrade_weechat_remove_file_cb); +} diff --git a/src/core/wee-upgrade.h b/src/core/wee-upgrade.h index 500a7eae4..856ccec99 100644 --- a/src/core/wee-upgrade.h +++ b/src/core/wee-upgrade.h @@ -38,5 +38,6 @@ enum t_upgrade_weechat_type int upgrade_weechat_save (); int upgrade_weechat_load (); +void upgrade_weechat_remove_files (); #endif /* wee-upgrade.h */ diff --git a/src/core/weechat.c b/src/core/weechat.c index d32e0c53e..ac11bbc16 100644 --- a/src/core/weechat.c +++ b/src/core/weechat.c @@ -410,6 +410,8 @@ main (int argc, char *argv[]) argc, argv); command_startup (1); /* command executed after plugins */ gui_layout_window_apply (gui_layout_windows, -1); /* apply saved layout */ + if (weechat_upgrading) + upgrade_weechat_remove_files ();/* remove .upgrade files */ weechat_upgrading = 0; gui_main_loop (); /* WeeChat main loop */ |