diff options
| author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-02-03 15:55:59 +0100 |
|---|---|---|
| committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-02-03 15:55:59 +0100 |
| commit | 63c4d3bf043b3b52e38dbdc5dfafbe60cd82212b (patch) | |
| tree | 75e2062580e88ee0a8aaf585be93ee21a942a123 /lib | |
| parent | 6f22376579e925234181036c3e52832fc5dcf842 (diff) | |
| parent | 412ebc00ca3ccbbb6a60094a67d1402376298c85 (diff) | |
Merge branch 'master' into rhel6
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/Plugins/CCpp.cpp | 32 | ||||
| -rw-r--r-- | lib/Plugins/Makefile.am | 4 |
2 files changed, 33 insertions, 3 deletions
diff --git a/lib/Plugins/CCpp.cpp b/lib/Plugins/CCpp.cpp index dadff97..612d40c 100644 --- a/lib/Plugins/CCpp.cpp +++ b/lib/Plugins/CCpp.cpp @@ -575,7 +575,37 @@ string CAnalyzerCCpp::GetLocalUUID(const char *pDebugDumpDir) string unstrip_n_output = run_unstrip_n(pDebugDumpDir); string independentBuildIdPC; GetIndependentBuildIdPC(unstrip_n_output.c_str(), independentBuildIdPC); - return CreateHash((package + executable + independentBuildIdPC).c_str()); + + /* package variable has "firefox-3.5.6-1.fc11[.1]" format */ + /* Remove distro suffix and maybe least significant version number */ + char *trimmed_package = xstrdup(package.c_str()); + char *p = trimmed_package; + while (*p) + { + if (*p == '.' && (p[1] < '0' || p[1] > '9')) + { + /* We found "XXXX.nondigitXXXX", trim this part */ + *p = '\0'; + break; + } + p++; + } + char *first_dot = strchr(trimmed_package, '.'); + if (first_dot) + { + char *last_dot = strrchr(first_dot, '.'); + if (last_dot != first_dot) + { + /* There are more than one dot: "1.2.3" + * Strip last part, we don't want to distinquish crashes + * in packages which differ only by minor release number. + */ + *last_dot = '\0'; + } + } + string hash_str = trimmed_package + executable + independentBuildIdPC; + free(trimmed_package); + return CreateHash(hash_str.c_str()); } string CAnalyzerCCpp::GetGlobalUUID(const char *pDebugDumpDir) diff --git a/lib/Plugins/Makefile.am b/lib/Plugins/Makefile.am index a28fc22..e2bcf08 100644 --- a/lib/Plugins/Makefile.am +++ b/lib/Plugins/Makefile.am @@ -58,8 +58,8 @@ libCCpp_la_LDFLAGS = -avoid-version libCCpp_la_CPPFLAGS = -I$(srcdir)/../../inc -I$(srcdir)/../Utils \ -DCCPP_HOOK_PATH=\"${libexecdir}/abrt-hook-ccpp\" \ -DDEBUG_DUMPS_DIR=\"$(DEBUG_DUMPS_DIR)\" \ - -DLOCALSTATEDIR='"$(localstatedir)"' \ - -DHOSTILE_KERNEL + -DLOCALSTATEDIR='"$(localstatedir)"' +# -DHOSTILE_KERNEL # Firefox - disabled for now |
