diff options
author | David Malcolm <[email protected]> | 2009-12-05 11:42:07 -0500 |
---|---|---|
committer | David Malcolm <[email protected]> | 2009-12-05 11:42:07 -0500 |
commit | 730cee4366ecef3dfaf30e22b9d8ca96729148ec (patch) | |
tree | 7fdda0bd6889fe8e30f30b44d18fe88673a79407 | |
parent | 3acf0c0b601033194db225c8a15bf843742f1be0 (diff) | |
download | triage-730cee4366ecef3dfaf30e22b9d8ca96729148ec.tar.gz triage-730cee4366ecef3dfaf30e22b9d8ca96729148ec.tar.xz triage-730cee4366ecef3dfaf30e22b9d8ca96729148ec.zip |
Handle subpackages
-rwxr-xr-x | abrt-triage.py | 39 |
1 files changed, 24 insertions, 15 deletions
diff --git a/abrt-triage.py b/abrt-triage.py index 703f100..8f6a25d 100755 --- a/abrt-triage.py +++ b/abrt-triage.py @@ -73,7 +73,7 @@ def characterize_bt(bt, thread, script): function = None for (i, frame) in enumerate(thread.framelist): # Get function name for deepest point in stack that has one: - if function is None or function == '??' or function == 'vtable': + if function is None or function in ['??', 'vtable', '__kernel_vsyscall', 'raise', 'abort']: function = frame.function if frame.function == 'abort': @@ -136,16 +136,22 @@ def characterize_bt(bt, thread, script): def what_provides_file(path): - #from subprocess import Popen, PIPE - #p = Popen(['yum', 'whatprovides', path], stdout=PIPE) - #(stdout, stderr) = p.communicate() - #print repr(stdout) + ''' + Return a (subpackage, srpm) pair of names, or (None, None) + ''' + + # I'm running on 32-bit: fixup archs in path down to 32-bit version: + path = path.replace('/lib64/', '/lib/') + import yum my = yum.YumBase() my.setCacheDir() for pkg, path in my.searchPackageProvides([path]).iteritems(): - #pprint(pkg.__dict__) - return pkg.name # this is the subpackage, not the srpm + print pkg.sourcerpm + #print pkg.base_package_name + import rpmUtils + srpmName = rpmUtils.miscutils.splitFilename(pkg.sourcerpm)[0] + return (pkg.name, srpmName) class Change(object): ''' @@ -213,9 +219,12 @@ def get_change(bz, bug_id): script = bug.get_script() # script = '/usr/bin/deluged' if script: - pkg = what_provides_file(script) - else: - pkg = '(unknown)' + subpackage, srpmname = what_provides_file(script) + + if subpackage is None: + subpackage = '(unknown)' + if srpmname is None: + srpmname = '(unknown)' try: bt = bug.get_backtrace() @@ -224,7 +233,7 @@ def get_change(bz, bug_id): except NoBacktrace, e: return Change(newsummary='%s running %s' % (issue, script), - newcomponent = pkg, + newcomponent = srpmname, comment=('''Thank you for the bug report. Unfortunately, without a stack trace from the crash it is impossible to determine what caused the crash. Please see http://fedoraproject.org/wiki/StackTraces for more information about getting a useful stack trace with debugging symbols. Even if you cannot reproduce this crash at will, you can prepare your system now to produce a good stack trace the next time you experience the crash. @@ -250,19 +259,19 @@ You may find assistance in the Fedora community support forums or mailing list, How reproducable is this problem? If you run the program from a terminal, is an error message printed? -What version of %(pkg)s do you have installed? +What version of %(subpackage)s do you have installed? %(bt_blurb)s -Reassigning component from "python" to "%(pkg)s" -''' % dict(pkg=pkg, +Reassigning component from "python" to "%(subpackage)s" +''' % dict(subpackage=subpackage, bt_blurb = bt_blurb) if newsummary == 'Fatal error in "_XError" in /usr/share/virt-manager/virt-manager.py': return Duplicate(bz, 540810) ch = Change(newsummary = newsummary, - newcomponent = pkg, + newcomponent = srpmname, comment = comment ) |