diff options
| author | Karel Klic <kklic@redhat.com> | 2009-10-12 11:46:13 +0200 |
|---|---|---|
| committer | Karel Klic <kklic@redhat.com> | 2009-10-12 11:46:13 +0200 |
| commit | a41deef57d58ddcce264900885d94df37d23bff4 (patch) | |
| tree | 1b2975c952b3179dab1e09e4d3609fcfcf02d610 /lib | |
| parent | 691fd95d03763f803e499dba06c8caecb279427f (diff) | |
| parent | b88494a1bbfc8871642fe117d893f2970f543a1b (diff) | |
| download | abrt-a41deef57d58ddcce264900885d94df37d23bff4.tar.gz abrt-a41deef57d58ddcce264900885d94df37d23bff4.tar.xz abrt-a41deef57d58ddcce264900885d94df37d23bff4.zip | |
Merge branch 'master' of git://git.fedorahosted.org/git/abrt
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/Plugins/Bugzilla.GTKBuilder | 22 | ||||
| -rw-r--r-- | lib/Plugins/Bugzilla.cpp | 25 | ||||
| -rw-r--r-- | lib/Plugins/Bugzilla.h | 1 | ||||
| -rw-r--r-- | lib/Plugins/CCpp.cpp | 57 | ||||
| -rw-r--r-- | lib/Plugins/CCpp.h | 2 | ||||
| -rw-r--r-- | lib/Plugins/FileTransfer.cpp | 2 | ||||
| -rw-r--r-- | lib/Plugins/Kerneloops.h | 2 | ||||
| -rw-r--r-- | lib/Plugins/Python.h | 2 | ||||
| -rw-r--r-- | lib/Utils/Analyzer.h | 2 |
9 files changed, 74 insertions, 41 deletions
diff --git a/lib/Plugins/Bugzilla.GTKBuilder b/lib/Plugins/Bugzilla.GTKBuilder index 2c2d63c..998dc73 100644 --- a/lib/Plugins/Bugzilla.GTKBuilder +++ b/lib/Plugins/Bugzilla.GTKBuilder @@ -4,6 +4,8 @@ <!-- interface-naming-policy project-wide --> <object class="GtkDialog" id="PluginDialog"> <property name="border_width">5</property> + <property name="modal">True</property> + <property name="window_position">center-on-parent</property> <property name="type_hint">normal</property> <property name="has_separator">False</property> <child internal-child="vbox"> @@ -27,7 +29,7 @@ <child> <object class="GtkTable" id="table1"> <property name="visible">True</property> - <property name="n_rows">3</property> + <property name="n_rows">4</property> <property name="n_columns">2</property> <child> <object class="GtkLabel" id="lBugzillaURL"> @@ -93,6 +95,24 @@ <property name="bottom_attach">3</property> </packing> </child> + <child> + <object class="GtkCheckButton" id="cb_Password"> + <property name="label" translatable="yes">Show password</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">3</property> + <property name="bottom_attach">4</property> + </packing> + </child> + <child> + <placeholder/> + </child> </object> <packing> <property name="position">1</property> diff --git a/lib/Plugins/Bugzilla.cpp b/lib/Plugins/Bugzilla.cpp index a3c70f0..48c5eb5 100644 --- a/lib/Plugins/Bugzilla.cpp +++ b/lib/Plugins/Bugzilla.cpp @@ -147,28 +147,6 @@ bool CReporterBugzilla::CheckCCAndReporter(const std::string& pBugId) return false; } -void CReporterBugzilla::AddPlusOneComment(const std::string& pBugId) -{ - xmlrpc_c::paramList paramList; - map_xmlrpc_params_t addCommentParams; - map_xmlrpc_params_t ret; - - addCommentParams["id"] = xmlrpc_c::value_int(atoi(pBugId.c_str())); - addCommentParams["comment"] = xmlrpc_c::value_string("+1"); - - paramList.add(xmlrpc_c::value_struct(addCommentParams)); - xmlrpc_c::rpcPtr rpc(new xmlrpc_c::rpc("Bug.add_comment", paramList)); - try - { - rpc->call(m_pXmlrpcClient, m_pCarriageParm); - } - catch (std::exception& e) - { - throw CABRTException(EXCEP_PLUGIN, std::string("CReporterBugzilla::AddPlusOneComment(): ") + e.what()); - } - ret = xmlrpc_c::value_struct(rpc->getResult()); -} - void CReporterBugzilla::AddPlusOneCC(const std::string& pBugId) { xmlrpc_c::paramList paramList; @@ -424,10 +402,9 @@ std::string CReporterBugzilla::Report(const map_crash_report_t& pCrashReport, co update_client(_("Logging into bugzilla...")); Login(); m_bLoggedIn = true; - update_client(_("Check CC and add coment +1...")); + update_client(_("Checking CC...")); if (!CheckCCAndReporter(bugId) && m_bLoggedIn) { - AddPlusOneComment(bugId); AddPlusOneCC(bugId); } DeleteXMLRPCClient(); diff --git a/lib/Plugins/Bugzilla.h b/lib/Plugins/Bugzilla.h index c5098b3..f6a8976 100644 --- a/lib/Plugins/Bugzilla.h +++ b/lib/Plugins/Bugzilla.h @@ -18,7 +18,6 @@ class CReporterBugzilla : public CReporter void Login(); void Logout(); bool CheckCCAndReporter(const std::string& pBugId); - void AddPlusOneComment(const std::string& pBugId); void AddPlusOneCC(const std::string& pBugId); std::string CheckUUIDInBugzilla(const std::string& pComponent, const std::string& pUUID); std::string NewBug(const map_crash_report_t& pCrashReport); diff --git a/lib/Plugins/CCpp.cpp b/lib/Plugins/CCpp.cpp index c054c78..6b4ed04 100644 --- a/lib/Plugins/CCpp.cpp +++ b/lib/Plugins/CCpp.cpp @@ -107,6 +107,11 @@ static pid_t ExecVP(char** pArgs, uid_t uid, std::string& pOutput) } if (child == 0) { + VERB1 log("Executing: %s %s %s %s", pArgs[0] + ,pArgs[1] ? pArgs[1] : "" + ,pArgs[1] && pArgs[2] ? pArgs[2] : "" + ,pArgs[1] && pArgs[2] && pArgs[3] ? pArgs[3] : "" + ); close(pipeout[0]); /* read side of the pipe */ xmove_fd(pipeout[1], STDOUT_FILENO); /* Make sure stdin is safely open to nothing */ @@ -123,7 +128,9 @@ static pid_t ExecVP(char** pArgs, uid_t uid, std::string& pOutput) setsid(); execvp(pArgs[0], pArgs); - exit(0); + /* VERB1 since sometimes we expect errors here */ + VERB1 perror_msg("Can't execute '%s'", pArgs[0]); + exit(1); } close(pipeout[1]); /* write side of the pipe */ @@ -357,6 +364,7 @@ static void InstallDebugInfos(const std::string& pDebugDumpDir) log("Builting list of missing debuginfos"); // lines look like this: + // 0x400000+0x209000 23c77451cf6adff77fc1f5ee2a01d75de6511dda@0x40024c - - [exe] // 0x400000+0x209000 ab3c8286aac6c043fd1bb1cc2a0b88ec29517d3e@0x40024c /bin/sleep /usr/lib/debug/bin/sleep.debug [exe] // 0x7fff313ff000+0x1000 389c7475e3d5401c55953a425a2042ef62c4c7df@0x7fff313ff2f8 . - linux-vdso.so.1 vector_string_t missing; @@ -374,8 +382,10 @@ static void InstallDebugInfos(const std::string& pDebugDumpDir) char* endsp = strchr(word2, ' '); if (!endsp) continue; + /* endsp points to 2nd space in the line now*/ + /* This filters out linux-vdso.so, among others */ - if (endsp[1] != '/') + if (strstr(endsp, "[exe]") == NULL && endsp[1] != '/') continue; *endsp = '\0'; char* at = strchrnul(word2, '@'); @@ -435,8 +445,34 @@ static void InstallDebugInfos(const std::string& pDebugDumpDir) /*close(STDERR_FILENO);*/ setsid(); +/* Honestly, I do not know what is worse, pk-debuginfo-install or debuginfo-install: + +# pk-debuginfo-install -y -- coreutils-7.2-4.fc11 +1. Getting sources list...OK. Found 16 enabled and 23 disabled sources. +2. Finding debugging sources...OK. Found 0 disabled debuginfo repos. +3. Enabling debugging sources...OK. Enabled 0 debugging sources. +4. Finding debugging packages...Failed to find the package : more than one package found for +Failed to find the package : more than one package found for +FAILED. Found no packages to install. +5. Disabling sources previously enabled...OK. Disabled 0 debugging sources. + +:( FAIL! + +# debuginfo-install -y -- coreutils-7.2-4.fc11 +Loaded plugins: refresh-packagekit +Another application is holding the yum lock, cannot continue + +:( FAIL! + +# debuginfo-install -y -- coreutils-7.2-4.fc11 +(second time in a row - it worked) + +*/ + /* log() goes to stderr/syslog, it's ok to use it here */ + VERB1 log("Executing: %s %s %s %s", "pk-debuginfo-install", "-y", "--", package.c_str()); execlp("pk-debuginfo-install", "pk-debuginfo-install", "-y", "--", package.c_str(), NULL); /* fall back */ + VERB1 log("Executing: %s %s %s %s", "debuginfo-install", "-y", "--", package.c_str()); execlp("debuginfo-install", "debuginfo-install", "-y", "--", package.c_str(), NULL); exit(1); } @@ -578,7 +614,7 @@ static bool DebuginfoCheckPolkit(int uid) } -void CAnalyzerCCpp::CreateReport(const std::string& pDebugDumpDir) +void CAnalyzerCCpp::CreateReport(const std::string& pDebugDumpDir, int force) { update_client(_("Starting report creation...")); @@ -588,18 +624,19 @@ void CAnalyzerCCpp::CreateReport(const std::string& pDebugDumpDir) CDebugDump dd; dd.Open(pDebugDumpDir); - bool bt_exists = dd.Exist(FILENAME_BACKTRACE); - if (bt_exists) + if (!force) { - dd.Close(); /* do not keep dir locked longer than needed */ - return; /* already done */ + bool bt_exists = dd.Exist(FILENAME_BACKTRACE); + if (bt_exists) + { + return; /* backtrace already exists */ + } } dd.LoadText(FILENAME_PACKAGE, package); dd.LoadText(FILENAME_UID, UID); - dd.Close(); - + dd.Close(); /* do not keep dir locked longer than needed */ map_plugin_settings_t settings = GetSettings(); if (settings["InstallDebuginfo"] == "yes" && @@ -609,7 +646,7 @@ void CAnalyzerCCpp::CreateReport(const std::string& pDebugDumpDir) } else { - warn_client(_("Skipping debuginfo installation")); + VERB1 log(_("Skipping debuginfo installation")); } GetBacktrace(pDebugDumpDir, backtrace); diff --git a/lib/Plugins/CCpp.h b/lib/Plugins/CCpp.h index 92b6bab..3fbe0b9 100644 --- a/lib/Plugins/CCpp.h +++ b/lib/Plugins/CCpp.h @@ -38,7 +38,7 @@ class CAnalyzerCCpp : public CAnalyzer CAnalyzerCCpp(); virtual std::string GetLocalUUID(const std::string& pDebugDumpDir); virtual std::string GetGlobalUUID(const std::string& pDebugDumpDir); - virtual void CreateReport(const std::string& pDebugDumpDir); + virtual void CreateReport(const std::string& pDebugDumpDir, int force); virtual void Init(); virtual void DeInit(); virtual void SetSettings(const map_plugin_settings_t& pSettings); diff --git a/lib/Plugins/FileTransfer.cpp b/lib/Plugins/FileTransfer.cpp index 287eb39..3492156 100644 --- a/lib/Plugins/FileTransfer.cpp +++ b/lib/Plugins/FileTransfer.cpp @@ -197,7 +197,7 @@ static void create_tar(const char * archive_name, const char * directory) { return; } - tar_append_tree(tar, (char *)directory, "."); + tar_append_tree(tar, (char *)directory, (char*)"."); tar_close(tar); } diff --git a/lib/Plugins/Kerneloops.h b/lib/Plugins/Kerneloops.h index 1be58fc..13fb009 100644 --- a/lib/Plugins/Kerneloops.h +++ b/lib/Plugins/Kerneloops.h @@ -39,7 +39,7 @@ class CAnalyzerKerneloops : public CAnalyzer public: virtual std::string GetLocalUUID(const std::string& pDebugDumpDir); virtual std::string GetGlobalUUID(const std::string& pDebugDumpDir); - virtual void CreateReport(const std::string& pDebugDumpDir) {} + virtual void CreateReport(const std::string& pDebugDumpDir, int force) {} }; #endif diff --git a/lib/Plugins/Python.h b/lib/Plugins/Python.h index 57eefbf..b54de8d 100644 --- a/lib/Plugins/Python.h +++ b/lib/Plugins/Python.h @@ -10,7 +10,7 @@ class CAnalyzerPython : public CAnalyzer public: virtual std::string GetLocalUUID(const std::string& pDebugDumpDir); virtual std::string GetGlobalUUID(const std::string& pDebugDumpDir); - virtual void CreateReport(const std::string& pDebugDumpDir) {} + virtual void CreateReport(const std::string& pDebugDumpDir, int force) {} virtual void Init(); virtual void DeInit(); virtual std::string CreateHash(const std::string& pInput); diff --git a/lib/Utils/Analyzer.h b/lib/Utils/Analyzer.h index 4fe586b..e5bda57 100644 --- a/lib/Utils/Analyzer.h +++ b/lib/Utils/Analyzer.h @@ -50,7 +50,7 @@ class CAnalyzer : public CPlugin * somewhere afterwards. * @param pDebugDumpPath A debugdump dir containing all necessary data. */ - virtual void CreateReport(const std::string& pDebugDumpPath) = 0; + virtual void CreateReport(const std::string& pDebugDumpPath, int force) = 0; }; #endif /*ANALYZER_H_*/ |
