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

Proposed by Brian Murray on 2011-08-10
Status: Merged
Merge reported by: Steve Langasek
Merged at revision: not available
Proposed branch: lp:~brian-murray/ubuntu/oneiric/apport/package-dupe-sig
Merge into: lp:~ubuntu-core-dev/ubuntu/oneiric/apport/ubuntu
Diff against target: 45 lines (+27/-0)
2 files modified
data/general-hooks/ubuntu.py (+18/-0)
debian/changelog (+9/-0)
To merge this branch: bzr merge lp:~brian-murray/ubuntu/oneiric/apport/package-dupe-sig
Reviewer Review Type Date Requested Status
Steve Langasek 2011-08-10 Needs Fixing on 2011-08-10
Review via email: mp+71075@code.launchpad.net

Description of the change

This branch adds a DuplicateSignature tag to apport-package installation failures allowing them to be marked as duplicates by the retracer. For example:

DistroRelease: Ubuntu 11.10
DuplicateSignature:
 Setting up pytrainer (1.8.0-3) ...
 dpkg: error processing pytrainer (--configure):
  subprocess installed post-installation script returned error exit status
PackageArchitecture: all

I've tested this by installing the ubuntu general hook and creating a package installation failure as seen above. Additionally, I've written code to do the same thing and produced DuplicateSignatures for a collection of DpkgTerminalLog files which I have locally and it works well.

To post a comment you must log in.
1813. By Brian Murray on 2011-08-10

don't create a duplicate signature for post-installation failures

Steve Langasek (vorlon) wrote :

It's redundant to check for "Setting up" in the log if we're going to exclude anything matching a "post-installation script returned error", since these two lines will always go hand-in-hand in a dpkg failure.

review: Needs Fixing
Steve Langasek (vorlon) wrote :

after discussing, have merged the last-but-one revision from this branch.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'data/general-hooks/ubuntu.py'
2--- data/general-hooks/ubuntu.py 2011-07-22 14:51:08 +0000
3+++ data/general-hooks/ubuntu.py 2011-08-10 16:48:35 +0000
4@@ -72,6 +72,24 @@
5 if package:
6 attach_upstart_overrides(report, package)
7
8+ # build a duplicate signature tag for package reports
9+ if report.get('ProblemType') == 'Package':
10+ dupe_sig = ''
11+ for line in report['DpkgTerminalLog']:
12+ if line.startswith('Setting up') or line.startswith('Unpacking'):
13+ dupe_sig = line
14+ continue
15+ dupe_sig += line
16+ if 'dpkg: error' in dupe_sig and line.startswith(' '):
17+ if 'trying to overwrite' in line:
18+ report['Tags'] += 'package-conflict'
19+ elif 'post-installation script returned error' in line:
20+ break
21+ if 'Setting up' in dupe_sig or 'Unpacking' in dupe_sig:
22+ report['DuplicateSignature'] = dupe_sig
23+ # the duplicate signature should be the first failure
24+ break
25+
26 # running Unity?
27 username = pwd.getpwuid(os.geteuid()).pw_name
28 if subprocess.call(['killall', '-s0', '-u', username,
29
30=== modified file 'debian/changelog'
31--- debian/changelog 2011-08-04 18:57:17 +0000
32+++ debian/changelog 2011-08-10 16:48:35 +0000
33@@ -1,3 +1,12 @@
34+apport (1.21.2-0ubuntu11) oneiric; urgency=low
35+
36+ * data/general-hooks/ubuntu.py:
37+ - create a duplicate signature for package installation failures
38+ - tag install failures due to a package conflict 'package-conflict'
39+ (LP: #368435)
40+
41+ -- Brian Murray <brian@ubuntu.com> Wed, 10 Aug 2011 09:02:04 -0700
42+
43 apport (1.21.2-0ubuntu10) oneiric; urgency=low
44
45 * data/package-hooks/source_debian-installer.py:

Subscribers

People subscribed via source and target branches