1
'''Attach generally useful information, not specific to any package.
3
Copyright (C) 2009 Canonical Ltd.
4
Author: Matt Zimmerman <mdz@canonical.com>
6
This program is free software; you can redistribute it and/or modify it
7
under the terms of the GNU General Public License as published by the
8
Free Software Foundation; either version 2 of the License, or (at your
9
option) any later version. See http://www.gnu.org/copyleft/gpl.html for
10
the full text of the license.
1
'''Attach generally useful information, not specific to any package.'''
3
# Copyright (C) 2009 Canonical Ltd.
4
# Authors: Matt Zimmerman <mdz@canonical.com>
5
# Martin Pitt <martin.pitt@ubuntu.com>
7
# This program is free software; you can redistribute it and/or modify it
8
# under the terms of the GNU General Public License as published by the
9
# Free Software Foundation; either version 2 of the License, or (at your
10
# option) any later version. See http://www.gnu.org/copyleft/gpl.html for
11
# the full text of the license.
14
14
import apport.hookutils
35
35
free some space.' % (mounts[mount], free_mb)
37
37
# important glib errors/assertions (which should not have private data)
39
xsession_errors_path = os.path.join(home, '.xsession-errors')
40
if os.path.exists(xsession_errors_path):
41
filter = re.compile('^(\(.*:\d+\): \w+-(WARNING|CRITICAL|ERROR))|(Error: .*No Symbols named)')
42
for line in open(xsession_errors_path):
43
if filter.match(line):
44
xsession_errors += line
46
report['XsessionErrors'] = xsession_errors
38
if 'ExecutablePath' in report:
39
path = report['ExecutablePath']
40
if (apport.hookutils.links_with_shared_library(path, 'libgtk') or
41
apport.hookutils.links_with_shared_library(path, 'libX11')):
43
pattern = re.compile('^(\(.*:\d+\): \w+-(WARNING|CRITICAL|ERROR))|(Error: .*No Symbols named)')
44
xsession_errors = apport.hookutils.xsession_errors(pattern)
46
report['XsessionErrors'] = xsession_errors
49
if os.path.exists(os.path.expanduser('~/.ecryptfs/wrapped-passphrase')):
50
report['EcryptfsInUse'] = 'Yes'
52
# filter out crashes on missing GLX (LP#327673)
53
if '/usr/lib/libGL.so' in report.get('StacktraceTop', '\n').splitlines()[0] \
54
and 'Loading extension GLX' not in apport.hookutils.read_file('/var/log/Xorg.0.log'):
55
report['UnreportableReason'] = 'The X.org server does not support the GLX extension, which the crashed program expected to use.'
48
58
if __name__ == '__main__':