diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-02-03 15:55:00 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-02-03 15:55:00 +0100 |
commit | 412ebc00ca3ccbbb6a60094a67d1402376298c85 (patch) | |
tree | 7425c8f1199dffe4f84c0ff353243e02c70f77e3 /lib/Plugins | |
parent | 539deb3da4d59a568dc7c8ca9d6c077ed53a351f (diff) | |
download | abrt-412ebc00ca3ccbbb6a60094a67d1402376298c85.tar.gz abrt-412ebc00ca3ccbbb6a60094a67d1402376298c85.tar.xz abrt-412ebc00ca3ccbbb6a60094a67d1402376298c85.zip |
CCpp analyzer: change duphash calculation to group minor versions together
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'lib/Plugins')
-rw-r--r-- | lib/Plugins/CCpp.cpp | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/lib/Plugins/CCpp.cpp b/lib/Plugins/CCpp.cpp index dadff976..612d40c3 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) |