Merge lp:~brian-murray/ubuntu/oneiric/apport/ubiquity-dupe-sig into lp:~ubuntu-core-dev/ubuntu/oneiric/apport/ubuntu

Proposed by Brian Murray
Status: Merged
Merged at revision: 1830
Proposed branch: lp:~brian-murray/ubuntu/oneiric/apport/ubiquity-dupe-sig
Merge into: lp:~ubuntu-core-dev/ubuntu/oneiric/apport/ubuntu
Diff against target: 74 lines (+49/-0)
2 files modified
data/package-hooks/source_ubiquity.py (+42/-0)
debian/changelog (+7/-0)
To merge this branch: bzr merge lp:~brian-murray/ubuntu/oneiric/apport/ubiquity-dupe-sig
Reviewer Review Type Date Requested Status
Martin Pitt Pending
Ubuntu Core Development Team Pending
Review via email: mp+72989@code.launchpad.net

Description of the change

This branch creates a DuplicateSignature for ubiquity bug reports using information in syslog and if there is an error with grub-installer changes the source package to grub-installer. This is testable by modifying your '/var/log/installer/syslog' file to include grub-installer messages or add in a Traceback.

I personally have tested it with a syslog including grub-installer messages and saw the source package changed. I also used a syslog with just a Traceback and verified the contents of the DuplicateSignature. Finally I used a syslog with no Traceback or grub-installer messages and saw no DuplicateSignature. I'd really like to get this merged as soon as possible.

To post a comment you must log in.
Revision history for this message
Martin Pitt (pitti) wrote :

Brian, it seems something went wrong with pushing your branch? There's no diff.

1830. By Brian Murray

data/package-hooks/source_ubiquity.py: create a duplicate signature for
ubiquity bug reports using data in syslog

Revision history for this message
Brian Murray (brian-murray) wrote :

I've updated the branch.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'data/package-hooks/source_ubiquity.py'
2--- data/package-hooks/source_ubiquity.py 2011-08-17 14:35:45 +0000
3+++ data/package-hooks/source_ubiquity.py 2011-08-26 13:44:54 +0000
4@@ -22,6 +22,35 @@
5 apport.hookutils.attach_root_command_outputs(report,
6 {ident: "cat '%s'" % f})
7
8+
9+def prepare_duplicate_signature(syslog, collect_grub, collect_trace):
10+ collect = ''
11+ for line in syslog.split('\n'):
12+ if collect_grub:
13+ if 'grub-installer:' in line and collect == "":
14+ collect = ' '.join(line.split(' ')[4:]) + '\n'
15+ continue
16+ elif 'grub-installer:' in line and collect != "":
17+ collect += ' '.join(line.split(' ')[4:]) + '\n'
18+ continue
19+ if not collect_trace and collect != '':
20+ return collect
21+ if 'Traceback (most recent call last):' in line and \
22+ collect_grub:
23+ collect += ' '.join(line.split(' ')[5:]) + '\n'
24+ continue
25+ if 'Traceback (most recent call last):' in line and \
26+ not collect_grub:
27+ collect = ' '.join(line.split(' ')[5:]) + '\n'
28+ continue
29+ if len(line.split(' ')[5:]) == 1 and 'Traceback' in collect:
30+ if collect != '':
31+ return collect
32+ if not 'Traceback' in collect:
33+ continue
34+ collect += ' '.join(line.split(' ')[5:]) + '\n'
35+
36+
37 def add_info(report, ui):
38 add_installation_log(report, 'UbiquitySyslog', 'syslog')
39 syslog = report['UbiquitySyslog']
40@@ -37,6 +66,19 @@
41 ui.information("The system log from your installation contains an error. The specific error commonly occurs when there is an issue with the media from which you were installing. This can happen when your media is dirty or damaged or when you've burned the media at a high speed. Please try cleaning the media and or burning new media at a lower speed. In the event that you continue to encounter these errors it may be an issue with your CD / DVD drive.")
42 raise StopIteration
43
44+ collect_grub = False
45+ collect_trace = False
46+ if not 'grub-installer: Installation finished. No error reported' in syslog and 'grub-installer:' in syslog:
47+ collect_grub = True
48+ if 'Traceback' in syslog:
49+ collect_trace = True
50+ if collect_grub or collect_trace:
51+ duplicate_signature = prepare_duplicate_signature(syslog,
52+ collect_grub, collect_trace)
53+ report['DuplicateSignature'] = duplicate_signature
54+ if collect_grub:
55+ report['SourcePackage'] = 'grub-installer'
56+
57 match = re.search('ubiquity.*Ubiquity (.*)\n', report['UbiquitySyslog'])
58 if match:
59 match = match.group(1)
60
61=== modified file 'debian/changelog'
62--- debian/changelog 2011-08-25 14:31:41 +0000
63+++ debian/changelog 2011-08-26 13:44:54 +0000
64@@ -1,3 +1,10 @@
65+apport (1.22-0ubuntu2) oneiric; urgency=low
66+
67+ * data/package-hooks/source_ubiquity.py: create a duplicate signature for
68+ ubiquity bug reports using data in syslog
69+
70+ -- Brian Murray <brian@ubuntu.com> Thu, 25 Aug 2011 17:40:24 -0700
71+
72 apport (1.22-0ubuntu1) oneiric; urgency=low
73
74 [ Brian Murray ]

Subscribers

People subscribed via source and target branches