From 1e752b178131fa0268151219deb35e09c40e29bc Mon Sep 17 00:00:00 2001 From: Zdenek Prikryl Date: Wed, 29 Apr 2009 12:46:18 +0200 Subject: rework commlayerinner usage new lock method in debugdump --- lib/Plugins/CCpp.cpp | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'lib/Plugins/CCpp.cpp') diff --git a/lib/Plugins/CCpp.cpp b/lib/Plugins/CCpp.cpp index da52d0b2..62c1722e 100644 --- a/lib/Plugins/CCpp.cpp +++ b/lib/Plugins/CCpp.cpp @@ -23,10 +23,9 @@ #include "ABRTException.h" #include "DebugDump.h" #include "PluginSettings.h" -#include "ABRTCommLayer.h" +#include "CommLayerInner.h" #include #include -#include #include #include #include @@ -86,10 +85,10 @@ std::string CAnalyzerCCpp::CreateHash(const std::string& pInput) return ss.str(); } - +#include void CAnalyzerCCpp::InstallDebugInfos(const std::string& pPackage) { - ABRTCommLayer::status("Installing debug infos..."); + comm_layer_inner_status("Installing debug infos..."); std::string packageName = pPackage.substr(0, pPackage.rfind("-", pPackage.rfind("-")-1)); char buff[1024]; @@ -153,11 +152,18 @@ void CAnalyzerCCpp::InstallDebugInfos(const std::string& pPackage) else { buff[r] = '\0'; - std::cerr << buff; + comm_layer_inner_debug(buff); if (strstr(buff, packageName.c_str()) != NULL && strstr(buff, "already installed and latest version") != NULL) { - already_installed = true; + char* ii = strstr(buff, packageName.c_str()); + char* jj = strstr(ii, "\n"); + char* kk = strstr(ii, "already installed and latest version"); + + if (jj > kk) + { + already_installed = true; + } } if (already_installed == false && (strstr(buff, "No debuginfo packages available to install") != NULL || @@ -195,7 +201,7 @@ void CAnalyzerCCpp::InstallDebugInfos(const std::string& pPackage) void CAnalyzerCCpp::GetBacktrace(const std::string& pDebugDumpDir, std::string& pBacktrace) { - ABRTCommLayer::status("Getting backtrace..."); + comm_layer_inner_status("Getting backtrace..."); std::string tmpFile = "/tmp/" + pDebugDumpDir.substr(pDebugDumpDir.rfind("/")); std::ofstream fTmp; @@ -422,7 +428,7 @@ void CAnalyzerCCpp::ExecVP(const char* pCommand, char* const pArgs[], const std: std::string CAnalyzerCCpp::GetLocalUUID(const std::string& pDebugDumpDir) { - ABRTCommLayer::status("Getting local universal unique identification..."); + comm_layer_inner_status("Getting local universal unique identification..."); CDebugDump dd; std::string UID; @@ -446,7 +452,7 @@ std::string CAnalyzerCCpp::GetLocalUUID(const std::string& pDebugDumpDir) } std::string CAnalyzerCCpp::GetGlobalUUID(const std::string& pDebugDumpDir) { - ABRTCommLayer::status("Getting global universal unique identification..."); + comm_layer_inner_status("Getting global universal unique identification..."); std::string backtrace; std::string executable; @@ -464,7 +470,7 @@ std::string CAnalyzerCCpp::GetGlobalUUID(const std::string& pDebugDumpDir) void CAnalyzerCCpp::CreateReport(const std::string& pDebugDumpDir) { - ABRTCommLayer::status("Starting report creation..."); + comm_layer_inner_status("Starting report creation..."); std::string package; std::string backtrace; -- cgit