Merge lp:~ara/geis/apport_hook_lp_622817 into lp:~oif-team/geis/packaging

Proposed by Ara Pulido
Status: Merged
Merged at revision: 83
Proposed branch: lp:~ara/geis/apport_hook_lp_622817
Merge into: lp:~oif-team/geis/packaging
Diff against target: 162 lines (+144/-0)
3 files modified
debian/changelog (+6/-0)
debian/libutouch-geis1.install (+1/-0)
debian/source_utouch-geis.py (+137/-0)
To merge this branch: bzr merge lp:~ara/geis/apport_hook_lp_622817
Reviewer Review Type Date Requested Status
Chase Douglas (community) Approve
Open Input Framework Team Pending
Review via email: mp+33654@code.launchpad.net

Description of the change

This branch contains the apport hook for utouch packages. (LP: 622817)

Basically, the hook is the same for all the utouch packages, but it requires installation in those that do not depend in any others.

* mtdev (it includes symlinks to utouch and utouch-grail)
* utouch-gesturetest
* utouch-geis

These changes do not require a feature freeze exception (I already discussed it with pitti)

To post a comment you must log in.
Revision history for this message
Chase Douglas (chasedouglas) wrote :

As stated in the mtdev review, the release name should be UNRELEASED instead of maverick right now. That's the only issue I see.

review: Needs Fixing
lp:~ara/geis/apport_hook_lp_622817 updated
84. By Ara Pulido

Changed release name to UNRELEASED per utouch team policy

Revision history for this message
Ara Pulido (ara) wrote :

Modified accordingly. Thanks for the review!

Revision history for this message
Chase Douglas (chasedouglas) wrote :

Looks good.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2010-08-24 00:29:17 +0000
3+++ debian/changelog 2010-08-25 15:37:48 +0000
4@@ -1,3 +1,9 @@
5+utouch-geis (1.0.10-0ubuntu2) UNRELEASED; urgency=low
6+
7+ * Added apport hook for utouch-geis (LP: #622817)
8+
9+ -- Ara Pulido <ara@ubuntu.com> Wed, 25 Aug 2010 15:47:49 +0200
10+
11 utouch-geis (1.0.10-0ubuntu1) maverick; urgency=low
12
13 [ Stephen M. Webb ]
14
15=== modified file 'debian/libutouch-geis1.install'
16--- debian/libutouch-geis1.install 2010-08-13 10:06:22 +0000
17+++ debian/libutouch-geis1.install 2010-08-25 15:37:48 +0000
18@@ -1,1 +1,2 @@
19 usr/lib/lib*.so.*
20+debian/source_utouch-geis.py /usr/share/apport/package-hooks/
21
22=== added file 'debian/source_utouch-geis.py'
23--- debian/source_utouch-geis.py 1970-01-01 00:00:00 +0000
24+++ debian/source_utouch-geis.py 2010-08-25 15:37:48 +0000
25@@ -0,0 +1,137 @@
26+# Multitouch device related problems
27+# Author: Ara Pulido <ara@ubuntu.com>
28+# (C) 2010 Canonical Ltd.
29+# License: GPL v2 or later.
30+
31+from glob import glob
32+from subprocess import Popen, PIPE
33+import sys
34+import apport.hookutils
35+import time
36+import os
37+
38+# See linux/input.h
39+ABS_MT_POSITION_X = 0x35
40+
41+# scan-for-mt-devices written by Marc Tardif,
42+# based on a script by Henrik Rydberg
43+class Input(object):
44+
45+ def __init__(self, path):
46+ self.path = path
47+
48+ @property
49+ def device(self):
50+ base = os.path.basename(self.path)
51+ return os.path.join("/dev", "input", base)
52+
53+ @property
54+ def name(self):
55+ path = os.path.join(self.path, "device", "name")
56+ return read_line(path)
57+
58+ def get_capabilities(self):
59+ path = os.path.join(self.path, "device", "capabilities", "abs")
60+ line = read_line(path)
61+ capabilities = []
62+ long_bit = getconf("LONG_BIT")
63+ for i, word in enumerate(line.split(" ")):
64+ word = int(word, 16)
65+ subcapabilities = [bool(word & 1<<i) for i in range(long_bit)]
66+ capabilities[:0] = subcapabilities
67+
68+ return capabilities
69+
70+ def has_capability(self, capability):
71+ capabilities = self.get_capabilities()
72+ return len(capabilities) > capability and capabilities[capability]
73+
74+
75+def getconf(var):
76+ output = Popen(["getconf", var], stdout=PIPE).communicate()[0]
77+ return int(output)
78+
79+def get_inputs(path):
80+ event_glob = os.path.join(path, "event*")
81+ for event_path in glob(event_glob):
82+ yield Input(event_path)
83+
84+def read_line(path):
85+ f = open(path)
86+ try:
87+ return f.readline().strip()
88+ finally:
89+ f.close()
90+
91+def scan_for_mt_devices(report):
92+
93+ capability = ABS_MT_POSITION_X
94+ input = "/sys/class/input"
95+
96+ inputs = get_inputs(input)
97+ inputs = [i for i in inputs if i.has_capability(capability)]
98+
99+ report['MtDevices'] = ''
100+
101+ if inputs:
102+ for input in inputs:
103+ report['MtDevices'] += "%s: %s\n" % (input.name, input.device)
104+
105+ return 0
106+ else:
107+ report['MtDevices'] += "No capable devices found..."
108+ return 1
109+
110+##################################
111+
112+description = 'Multitouch device problem'
113+RELATED_PACKAGES = ['xserver-xorg', 'xserver-xorg-video-intel', 'xserver-xorg-video-ati', 'libmtdev1', 'libutouch-grail1', 'libutouch-geis1']
114+
115+
116+def add_info(report, ui):
117+
118+ report.setdefault('Tags', '')
119+ report['Tags'] += ' hci touch'
120+
121+ # Capture hardware
122+ apport.hookutils.attach_hardware(report)
123+ report['PciDisplay'] = apport.hookutils.pci_devices(apport.hookutils.PCI_DISPLAY)
124+
125+ # Attach the results of scan mt devices
126+ scan_for_mt_devices(report)
127+
128+ # Only collect the following data if X11 is available
129+ if os.environ.get('DISPLAY'):
130+ # For resolution/multi-head bugs
131+ report['Xrandr'] = apport.hookutils.command_output(['xrandr', '--verbose'])
132+ apport.hookutils.attach_file_if_exists(report,
133+ os.path.expanduser('~/.config/monitors.xml'),
134+ 'monitors.xml')
135+
136+ # Attach the Xorg logs and config
137+ apport.hookutils.attach_file_if_exists(report, '/etc/X11/xorg.conf', 'XorgConf')
138+ apport.hookutils.attach_file(report, '/var/log/Xorg.0.log', 'XorgLog')
139+ apport.hookutils.attach_file_if_exists(report, '/var/log/Xorg.0.log.old', 'XorgLogOld')
140+ apport.hookutils.attach_file_if_exists(report, '/var/log/gdm/:0.log', 'GdmLog')
141+ apport.hookutils.attach_file_if_exists(report, '/var/log/gdm/:0.log.1', 'GdmLogOld')
142+
143+
144+ # Attach the output of xinput
145+ report['XInput'] = apport.hookutils.command_output(['xinput', 'input'])
146+
147+ # Attach the output of lsinput
148+ report['LsInput'] = apport.hookutils.root_command_output(["lsinput"])
149+
150+ # Attach descriptors
151+ attach_descriptors(report)
152+
153+ apport.hookutils.attach_related_packages(report, RELATED_PACKAGES)
154+
155+def attach_descriptors(report):
156+ path = '/sys/kernel/debug/hid/*/rdesc'
157+ for desc in glob(path):
158+ name = desc.split('/')[5]
159+ name = name.replace(":", "").replace(".", "")
160+ report[name] = apport.hookutils.root_command_output(["cat", desc])
161+
162+

Subscribers

People subscribed via source and target branches