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

Proposed by Brian Murray
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 Needs Fixing
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

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

Revision history for this message
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
Revision history for this message
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
=== modified file 'data/general-hooks/ubuntu.py'
--- data/general-hooks/ubuntu.py 2011-07-22 14:51:08 +0000
+++ data/general-hooks/ubuntu.py 2011-08-10 16:48:35 +0000
@@ -72,6 +72,24 @@
72 if package:72 if package:
73 attach_upstart_overrides(report, package)73 attach_upstart_overrides(report, package)
7474
75 # build a duplicate signature tag for package reports
76 if report.get('ProblemType') == 'Package':
77 dupe_sig = ''
78 for line in report['DpkgTerminalLog']:
79 if line.startswith('Setting up') or line.startswith('Unpacking'):
80 dupe_sig = line
81 continue
82 dupe_sig += line
83 if 'dpkg: error' in dupe_sig and line.startswith(' '):
84 if 'trying to overwrite' in line:
85 report['Tags'] += 'package-conflict'
86 elif 'post-installation script returned error' in line:
87 break
88 if 'Setting up' in dupe_sig or 'Unpacking' in dupe_sig:
89 report['DuplicateSignature'] = dupe_sig
90 # the duplicate signature should be the first failure
91 break
92
75 # running Unity?93 # running Unity?
76 username = pwd.getpwuid(os.geteuid()).pw_name94 username = pwd.getpwuid(os.geteuid()).pw_name
77 if subprocess.call(['killall', '-s0', '-u', username,95 if subprocess.call(['killall', '-s0', '-u', username,
7896
=== modified file 'debian/changelog'
--- debian/changelog 2011-08-04 18:57:17 +0000
+++ debian/changelog 2011-08-10 16:48:35 +0000
@@ -1,3 +1,12 @@
1apport (1.21.2-0ubuntu11) oneiric; urgency=low
2
3 * data/general-hooks/ubuntu.py:
4 - create a duplicate signature for package installation failures
5 - tag install failures due to a package conflict 'package-conflict'
6 (LP: #368435)
7
8 -- Brian Murray <brian@ubuntu.com> Wed, 10 Aug 2011 09:02:04 -0700
9
1apport (1.21.2-0ubuntu10) oneiric; urgency=low10apport (1.21.2-0ubuntu10) oneiric; urgency=low
211
3 * data/package-hooks/source_debian-installer.py:12 * data/package-hooks/source_debian-installer.py:

Subscribers

People subscribed via source and target branches