diff options
-rw-r--r-- | lib/Plugins/Bugzilla.cpp | 11 | ||||
-rw-r--r-- | lib/Plugins/Bugzilla.h | 2 |
2 files changed, 8 insertions, 5 deletions
diff --git a/lib/Plugins/Bugzilla.cpp b/lib/Plugins/Bugzilla.cpp index bce5286c..2a1c1bb5 100644 --- a/lib/Plugins/Bugzilla.cpp +++ b/lib/Plugins/Bugzilla.cpp @@ -55,12 +55,12 @@ void CReporterBugzilla::Logout() } } -bool CReporterBugzilla::CheckUUIDInBugzilla(const std::string& pUUID) +bool CReporterBugzilla::CheckUUIDInBugzilla(const std::string& pComponent, const std::string& pUUID) { xmlrpc_c::paramList paramList; map_xmlrpc_params_t searchParams; map_xmlrpc_params_t ret; - std::string quicksearch = "component:\"abrt\" statuswhiteboard:\""+ pUUID + "\""; + std::string quicksearch = "component:\""+ pComponent +"\" statuswhiteboard:\""+ pUUID + "\""; searchParams["quicksearch"] = xmlrpc_c::value_string(quicksearch.c_str()); paramList.add(xmlrpc_c::value_struct(searchParams)); xmlrpc_c::rpcPtr rpc(new xmlrpc_c::rpc("Bug.search", paramList)); @@ -142,7 +142,7 @@ void CReporterBugzilla::NewBug(const map_crash_report_t& pCrashReport) bugParams["product"] = xmlrpc_c::value_string(product); bugParams["component"] = xmlrpc_c::value_string(component); bugParams["version"] = xmlrpc_c::value_string(version); - bugParams["summary"] = xmlrpc_c::value_string("TEST [abrt] crash detected in " + component); + bugParams["summary"] = xmlrpc_c::value_string("[abrt] crash detected in " + component); bugParams["description"] = xmlrpc_c::value_string(description); bugParams["status_whiteboard"] = xmlrpc_c::value_string("abrt_hash:" + pCrashReport.find(FILENAME_UUID)->second[CD_CONTENT]); bugParams["platform"] = xmlrpc_c::value_string(pCrashReport.find(FILENAME_ARCHITECTURE)->second[CD_CONTENT]); @@ -164,8 +164,11 @@ void CReporterBugzilla::NewBug(const map_crash_report_t& pCrashReport) void CReporterBugzilla::Report(const map_crash_report_t& pCrashReport) { + std::string package = pCrashReport.find(FILENAME_PACKAGE)->second[CD_CONTENT]; + std::string component = package.substr(0, package.rfind("-", package.rfind("-")-1)); + std::string uuid = pCrashReport.find(FILENAME_UUID)->second[CD_CONTENT]; Login(); - if (!CheckUUIDInBugzilla(pCrashReport.find(FILENAME_UUID)->second[CD_CONTENT])) + if (!CheckUUIDInBugzilla(component, uuid)) { NewBug(pCrashReport); } diff --git a/lib/Plugins/Bugzilla.h b/lib/Plugins/Bugzilla.h index 53ce05fda..ff6d5510 100644 --- a/lib/Plugins/Bugzilla.h +++ b/lib/Plugins/Bugzilla.h @@ -12,7 +12,7 @@ class CReporterBugzilla : public CReporter void Login(); void Logout(); - bool CheckUUIDInBugzilla(const std::string& pUUID); + bool CheckUUIDInBugzilla(const std::string& pComponent, const std::string& pUUID); void NewBug(const map_crash_report_t& pCrashReport); void CreateNewBugDescription(const map_crash_report_t& pCrashReport, std::string& pDescription); |