~thopiekar/+junk/bluez-packaging

« back to all changes in this revision

Viewing changes to source_bluez.py

  • Committer: Thomas-Karl Pietrowski
  • Date: 2014-03-08 16:13:12 UTC
  • Revision ID: thopiekar@googlemail.com-20140308161312-zl5h740vtuaggu36
syncing with debian packaging

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/python
2
 
# -*- coding: utf-8 -*-
3
 
'''apport package hook for bluez
4
 
 
5
 
(c) 2010 Free Software Foundation
6
 
Author:
7
 
Baptiste Mille-Mathias <baptistem@src.gnome.org>
8
 
 
9
 
'''
10
 
from apport.hookutils import *
11
 
import re
12
 
 
13
 
def add_info(report, ui):
14
 
    report['syslog'] = recent_syslog(re.compile(r'bluetooth', re.IGNORECASE))
15
 
    attach_hardware(report)
16
 
    if command_available('hciconfig'):
17
 
        report['hciconfig'] = command_output('hciconfig')
18
 
    if command_available('rfkill'):
19
 
        report['rfkill'] = command_output(['rfkill','list'])
20
 
    if command_available('getfacl'):
21
 
        report['getfacl'] = command_output(['getfacl','/dev/rfkill'])
22
 
 
23
 
    interesting_modules = ('btusb', 'rfcomm', 'sco', 'bnep', 'l2cap', 'bluetooth')
24
 
    interesting_modules_loaded = []
25
 
 
26
 
    for line in open('/proc/modules'):
27
 
        module = line.split()[0]
28
 
        if module in interesting_modules:
29
 
            interesting_modules_loaded.append(module)
30
 
 
31
 
    if interesting_modules_loaded:
32
 
        report['InterestingModules'] = ' '.join(interesting_modules_loaded)
33
 
 
34
 
    ui.information("""Your bug report will be processed in few seconds.
35
 
If you can reproduce it, please follow the next steps:
36
 
    - Install the package 'bluez-hcidump'
37
 
    - Open a new terminal
38
 
    - Run the command "sudo hcidump -XYt > $HOME/hci.log"
39
 
    - Reproduce the actions until the error happens
40
 
    - On the terminal, press Ctrl+C to stop hcidump.
41
 
    - Attach the file hci.log to the bug report.""")