diff options
| author | Jiri Moskovcak <jmoskovc@redhat.com> | 2009-11-09 15:58:19 +0100 |
|---|---|---|
| committer | Jiri Moskovcak <jmoskovc@redhat.com> | 2009-11-09 15:58:19 +0100 |
| commit | 3791b2f692f49f3cc2355584663c26cc6ddee526 (patch) | |
| tree | 867b1baaec1b78dde644c5c503bc72edc579733f | |
| parent | e8e664c896e533003d4c206190ff4f2c3fe4e01d (diff) | |
| parent | 324e1c37631ac28d79a1d88e30c74c5a0a819958 (diff) | |
| download | abrt-3791b2f692f49f3cc2355584663c26cc6ddee526.tar.gz abrt-3791b2f692f49f3cc2355584663c26cc6ddee526.tar.xz abrt-3791b2f692f49f3cc2355584663c26cc6ddee526.zip | |
Merge branch 'master' of ssh://git.fedorahosted.org/git/abrt
| -rw-r--r-- | lib/Plugins/CCpp.cpp | 13 | ||||
| -rw-r--r-- | po/pt_BR.po | 38 | ||||
| -rw-r--r-- | src/Daemon/Daemon.cpp | 13 | ||||
| -rw-r--r-- | src/Daemon/MiddleWare.cpp | 51 | ||||
| -rw-r--r-- | src/Daemon/MiddleWare.h | 7 |
5 files changed, 57 insertions, 65 deletions
diff --git a/lib/Plugins/CCpp.cpp b/lib/Plugins/CCpp.cpp index 6d6edd5..1ab0e64 100644 --- a/lib/Plugins/CCpp.cpp +++ b/lib/Plugins/CCpp.cpp @@ -164,6 +164,8 @@ static LineRating rate_line(const char *line) { #define FOUND(x) (strstr(line, x) != NULL) /* see the "enum LineRating" comments for possible combinations */ + if (FOUND(" at ")) + return Good; const char *function = strstr(line, " in "); if (function) { @@ -171,12 +173,6 @@ static LineRating rate_line(const char *line) { function = NULL; } - else - { - bool source_file = FOUND(" at "); - if (source_file) - return Good; - } } bool library = FOUND(" from "); if (function && library) @@ -193,7 +189,7 @@ static LineRating rate_line(const char *line) /* returns number of "stars" to show */ static int rate_backtrace(const char *backtrace) { - int i, len; + int i, j, len; int multiplier = 0; int rating = 0; int best_possible_rating = 0; @@ -210,6 +206,9 @@ static int rate_backtrace(const char *backtrace) if (backtrace[i] == '#') /* this separates frames from each other */ { std::string s(backtrace + i + 1, len); + for (j=0; j<len; j++) /* replace tabs with spaces */ + if (s[j] == '\t') + s[j] = ' '; multiplier++; rating += rate_line(s.c_str()) * multiplier; best_possible_rating += BestRating * multiplier; diff --git a/po/pt_BR.po b/po/pt_BR.po index d59875c..d913927 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: ABRT\n" "Report-Msgid-Bugs-To: jmoskovc@redhat.com\n" -"POT-Creation-Date: 2009-11-06 15:36+0000\n" -"PO-Revision-Date: 2009-11-06 17:43-0300\n" +"POT-Creation-Date: 2009-11-09 09:30+0000\n" +"PO-Revision-Date: 2009-11-09 11:04-0300\n" "Last-Translator: Igor Pires Soares <igor@projetofedora.org>\n" "Language-Team: Brazilian Portuguese <fedora-trans-pt_br@redhat.com>\n" "MIME-Version: 1.0\n" @@ -436,12 +436,14 @@ msgid "Report size exceeded the quota. Please check system's MaxCrashReportsSize msgstr "O tamanho do relatório excedeu a cota. Por favor, verifique o valor MaxCrashReportsSize do sistema no abrt.conf." #: ../lib/Plugins/Bugzilla.cpp:316 -msgid "Bug is already reported: " -msgstr "O erro já foi relatado: " +#, c-format +msgid "Bug is already reported: %i" +msgstr "O erro já foi relatado: %i" #: ../lib/Plugins/Bugzilla.cpp:378 -msgid "New bug id: " -msgstr "Novo id do erro: " +#, c-format +msgid "New bug id: %i" +msgstr "Novo id do erro: %i" #: ../lib/Plugins/Bugzilla.cpp:471 msgid "Checking for duplicates..." @@ -505,7 +507,7 @@ msgstr "Pulando instalação do debuginfo" msgid "Creating and submitting a report..." msgstr "Criando e enviando um relatório..." -#: ../lib/Plugins/Logger.cpp:59 +#: ../lib/Plugins/Logger.cpp:57 #: ../lib/Plugins/Mailx.cpp:124 msgid "Creating a report..." msgstr "Criando um relatório..." @@ -515,7 +517,7 @@ msgid "Executing RunApp plugin..." msgstr "Executando o plugin RunApp..." #: ../lib/Plugins/FileTransfer.cpp:63 -#: ../lib/Plugins/FileTransfer.cpp:384 +#: ../lib/Plugins/FileTransfer.cpp:381 msgid "FileTransfer: URL not specified" msgstr "FileTransfer: URL não especificada" @@ -524,14 +526,19 @@ msgstr "FileTransfer: URL não especificada" msgid "Sending archive %s to %s" msgstr "Enviando o pacote %s para %s" -#: ../lib/Plugins/FileTransfer.cpp:310 +#: ../lib/Plugins/FileTransfer.cpp:309 msgid "File Transfer: Creating a report..." msgstr "File Transfer: Criando um relatório..." -#: ../lib/Plugins/FileTransfer.cpp:335 -#: ../lib/Plugins/FileTransfer.cpp:361 -msgid "CFileTransfer::Run(): Cannot create and send an archive: " -msgstr "CFileTransfer::Run(): Não foi possível criar e enviar o pacote: " +#: ../lib/Plugins/FileTransfer.cpp:334 +#, c-format +msgid "Can't create and send an archive: %s" +msgstr "Não foi possível criar e enviar o pacote: %s" + +#: ../lib/Plugins/FileTransfer.cpp:359 +#, c-format +msgid "Can't create and send an archive %s" +msgstr "Não foi possível criar e enviar o pacote %s" #: ../lib/Plugins/KerneloopsScanner.cpp:84 msgid "Creating kernel oops crash reports..." @@ -546,8 +553,9 @@ msgid "Executing SOSreport plugin..." msgstr "Executando o plugin SOSreport..." #: ../lib/Plugins/SOSreport.cpp:122 -msgid "running sosreport: " -msgstr "executando o sosreport: " +#, c-format +msgid "running sosreport: %s" +msgstr "executando o sosreport: %s" #: ../lib/Plugins/SOSreport.cpp:137 msgid "done running sosreport" diff --git a/src/Daemon/Daemon.cpp b/src/Daemon/Daemon.cpp index 67e72cc..2945cc2 100644 --- a/src/Daemon/Daemon.cpp +++ b/src/Daemon/Daemon.cpp @@ -165,18 +165,6 @@ static double GetDirSize(const std::string &pPath, std::string *worst_dir = NULL return size; } -static bool analyzer_has_InformAllUsers(const char *analyzer_name) -{ - CAnalyzer* analyzer = g_pPluginManager->GetAnalyzer(analyzer_name); - if (!analyzer) - return false; - map_plugin_settings_t settings = analyzer->GetSettings(); - map_plugin_settings_t::const_iterator it = settings.find("InformAllUsers"); - if (it == settings.end()) - return false; - return string_to_bool(it->second.c_str()); -} - static void cron_delete_callback_data_cb(gpointer data) { cron_callback_data_t* cronDeleteCallbackData = static_cast<cron_callback_data_t*>(data); @@ -556,7 +544,6 @@ static gboolean handle_inotify_cb(GIOChannel *gio, GIOCondition condition, gpoin : crashinfo[CD_UID][CD_CONTENT].c_str(); g_pCommLayer->Crash(crashinfo[CD_PACKAGE][CD_CONTENT].c_str(), uid_str); } - //DeleteDebugDumpDir(fullname.c_str()); break; case MW_BLACKLISTED: case MW_CORRUPTED: diff --git a/src/Daemon/MiddleWare.cpp b/src/Daemon/MiddleWare.cpp index 6a63564..0bc358e 100644 --- a/src/Daemon/MiddleWare.cpp +++ b/src/Daemon/MiddleWare.cpp @@ -456,10 +456,9 @@ void DeleteDebugDumpDir(const char *pDebugDumpDir) std::string DeleteCrashInfo(const char *pUUID, const char *pUID) { - database_row_t row; CDatabase* database = g_pPluginManager->GetDatabase(g_settings_sDatabase); database->Connect(); - row = database->GetUUIDData(pUUID, pUID); + database_row_t row = database->GetUUIDData(pUUID, pUID); database->Delete(pUUID, pUID); database->DisConnect(); @@ -573,6 +572,21 @@ static mw_result_t SavePackageDescriptionToDebugDump(const char *pExecutable, return MW_OK; } +bool analyzer_has_InformAllUsers(const char *analyzer_name) +{ + CAnalyzer* analyzer = g_pPluginManager->GetAnalyzer(analyzer_name); + if (!analyzer) + { + VERB1 log("Strange, asked for analyzer %s but it doesn't exist?", analyzer_name); + return false; + } + map_plugin_settings_t settings = analyzer->GetSettings(); + map_plugin_settings_t::const_iterator it = settings.find("InformAllUsers"); + if (it == settings.end()) + return false; + return string_to_bool(it->second.c_str()); +} + /** * Execute all action plugins, which are associated to * particular analyzer plugin. @@ -621,14 +635,12 @@ static mw_result_t SaveDebugDumpToDatabase(const char *pUUID, const char *pDebugDumpDir, map_crash_info_t& pCrashInfo) { - mw_result_t res; CDatabase* database = g_pPluginManager->GetDatabase(g_settings_sDatabase); - database_row_t row; database->Connect(); database->Insert(pUUID, pUID, pDebugDumpDir, pTime); - row = database->GetUUIDData(pUUID, pUID); + database_row_t row = database->GetUUIDData(pUUID, pUID); database->DisConnect(); - res = GetCrashInfo(pUUID, pUID, pCrashInfo); + mw_result_t res = GetCrashInfo(pUUID, pUID, pCrashInfo); if (row.m_sReported == "1") { log("Crash is already reported"); @@ -646,29 +658,19 @@ std::string getDebugDumpDir(const char *pUUID, const char *pUID) { CDatabase* database = g_pPluginManager->GetDatabase(g_settings_sDatabase); - database_row_t row; database->Connect(); - row = database->GetUUIDData(pUUID, pUID); + database_row_t row = database->GetUUIDData(pUUID, pUID); database->DisConnect(); return row.m_sDebugDumpDir; } -mw_result_t SaveDebugDump(const char *pDebugDumpDir) -{ - map_crash_info_t info; - return SaveDebugDump(pDebugDumpDir, info); -} - mw_result_t SaveDebugDump(const char *pDebugDumpDir, map_crash_info_t& pCrashInfo) { - std::string lUUID; std::string UID; std::string time; std::string analyzer; std::string executable; - mw_result_t res; - try { CDebugDump dd; @@ -692,15 +694,17 @@ mw_result_t SaveDebugDump(const char *pDebugDumpDir, { return MW_IN_DB; } - res = SavePackageDescriptionToDebugDump(executable.c_str(), pDebugDumpDir); + mw_result_t res = SavePackageDescriptionToDebugDump(executable.c_str(), pDebugDumpDir); if (res != MW_OK) { return res; } - lUUID = GetLocalUUID(analyzer.c_str(), pDebugDumpDir); - - return SaveDebugDumpToDatabase(lUUID.c_str(), UID.c_str(), time.c_str(), pDebugDumpDir, pCrashInfo); + std::string lUUID = GetLocalUUID(analyzer.c_str(), pDebugDumpDir); + const char *uid_str = analyzer_has_InformAllUsers(analyzer.c_str()) + ? "-1" + : UID.c_str(); + return SaveDebugDumpToDatabase(lUUID.c_str(), uid_str, time.c_str(), pDebugDumpDir, pCrashInfo); } mw_result_t GetCrashInfo(const char *pUUID, @@ -709,16 +713,14 @@ mw_result_t GetCrashInfo(const char *pUUID, { pCrashInfo.clear(); CDatabase* database = g_pPluginManager->GetDatabase(g_settings_sDatabase); - database_row_t row; database->Connect(); - row = database->GetUUIDData(pUUID, pUID); + database_row_t row = database->GetUUIDData(pUUID, pUID); database->DisConnect(); std::string package; std::string executable; std::string description; std::string analyzer; - try { CDebugDump dd; @@ -737,6 +739,7 @@ mw_result_t GetCrashInfo(const char *pUUID, } return MW_ERROR; } + add_crash_data_to_crash_info(pCrashInfo, CD_EXECUTABLE, executable); add_crash_data_to_crash_info(pCrashInfo, CD_PACKAGE, package); add_crash_data_to_crash_info(pCrashInfo, CD_DESCRIPTION, description); diff --git a/src/Daemon/MiddleWare.h b/src/Daemon/MiddleWare.h index 0671dd0..ac042de 100644 --- a/src/Daemon/MiddleWare.h +++ b/src/Daemon/MiddleWare.h @@ -120,12 +120,6 @@ void DeleteDebugDumpDir(const char *pDebugDumpDir); std::string DeleteCrashInfo(const char *pUUID, const char *pUID); /** - * Saves debugdump into database. - * @param pDebugDumpDir A debugdump directory. - * @return It return results of operation. See mw_result_t. - */ -mw_result_t SaveDebugDump(const char *pDebugDumpDir); -/** * Saves debugdump into database. If saving is successful, * it fills crash info. * @param pDebugDumpDir A debugdump directory. @@ -171,5 +165,6 @@ void AddAnalyzerActionOrReporter(const char *pAnalyzer, void AddActionOrReporter(const char *pActionOrReporter, const char *pArgs); +bool analyzer_has_InformAllUsers(const char *analyzer_name); #endif /*MIDDLEWARE_H_*/ |
