diff options
author | Karel Klic <kklic@redhat.com> | 2010-03-26 17:55:51 +0100 |
---|---|---|
committer | Karel Klic <kklic@redhat.com> | 2010-03-26 18:11:09 +0100 |
commit | 7ccd55eb10921e94a81b699a2c96cb1dc25515d1 (patch) | |
tree | 66297ccd0633eb5b8f817c3d710c36b267b3bc61 /scripts/abrt-bz-hashchecker | |
parent | 605c31f9d0897c18a900c7a4c0ad75bc439d18e5 (diff) | |
download | abrt-7ccd55eb10921e94a81b699a2c96cb1dc25515d1.tar.gz abrt-7ccd55eb10921e94a81b699a2c96cb1dc25515d1.tar.xz abrt-7ccd55eb10921e94a81b699a2c96cb1dc25515d1.zip |
Move backtrace parser from src/Backtrace to lib/Utils.
Move abrt-backtrace app from src/Backtrace/main.c to src/utils/abrt-backtrace.
Move backtrace preprocessign code from abrt-backtrace to the parser.
Implemented new backtrace rating algorithm.
Added old bt rating algorithm to backtrace.c
Move strbuf to lib/Utils, and updated it to use xfuncs.
Created separate header for xfuncs.
Some functions in xfuncs marked as extern "c", so they can be used
in C code.
Merged backtrace fallback (independent_backtrace) "parser" into
backtrace.{h/c}.
Added option --rate to abrt-backtrace, to be able to use the new
backtrace rating algorithm in scripts.
Diffstat (limited to 'scripts/abrt-bz-hashchecker')
-rwxr-xr-x | scripts/abrt-bz-hashchecker | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/scripts/abrt-bz-hashchecker b/scripts/abrt-bz-hashchecker new file mode 100755 index 00000000..ec7ce1a6 --- /dev/null +++ b/scripts/abrt-bz-hashchecker @@ -0,0 +1,59 @@ +#!/usr/bin/python +# -*- mode:python -*- +# Checks how many bugs in Bugzilla have the same hash. +# +# Please do not run this script unless it's neccessary to do so. +# It forces Bugzilla to send data related to thousands of bug reports. + +from bugzilla import RHBugzilla +from optparse import OptionParser +import sys +import os.path +import subprocess +import re + +parser = OptionParser(version="%prog 1.0") +parser.add_option("-u", "--user", dest="user", + help="Bugzilla user name (REQUIRED)", metavar="USERNAME") +parser.add_option("-p", "--password", dest="password", + help="Bugzilla password (REQUIRED)", metavar="PASSWORD") +parser.add_option("-b", "--bugzilla", dest="bugzilla", + help="Bugzilla URL (defaults to Red Hat Bugzilla)", metavar="URL") + +(options, args) = parser.parse_args() + +if not options.user or len(options.user) == 0: + parser.error("User name is required.\nTry {0} --help".format(sys.argv[0])) + +if not options.password or len(options.password) == 0: + parser.error("Password is required.\nTry {0} --help".format(sys.argv[0])) + +if not options.bugzilla or len(options.bugzilla) == 0: + options.bugzilla = "https://bugzilla.redhat.com/xmlrpc.cgi" + +bz = RHBugzilla() +bz.connect(options.bugzilla) +bz.login(options.user, options.password) + +buginfos = bz.query({'status_whiteboard_type':'allwordssubstr','status_whiteboard':'abrt_hash'}) + +print "{0} bugs found.".format(len(buginfos)) + +hashes = {} +for buginfo in buginfos: + match = re.search("abrt_hash:([^ ]+)", buginfo.status_whiteboard) + if not match: + continue + hash = match.group(1) + if not hash: + continue + if hash in hashes: + hashes[hash].append(buginfo.bug_id) + else: + hashes[hash] = [ buginfo.bug_id ] + print hash +bz.logout() + +for hash, ids in hashes.items(): + if len(ids) > 1: + print "Duplicates found: ", reduce(lambda x,y: str(x)+", "+str(y), ids) |