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

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

Subscribers

People subscribed via source and target branches