Merge lp:~brian-murray/apport/recoverable-problem-dupesig into lp:~apport-hackers/apport/trunk

Proposed by Brian Murray
Status: Merged
Merged at revision: 2947
Proposed branch: lp:~brian-murray/apport/recoverable-problem-dupesig
Merge into: lp:~apport-hackers/apport/trunk
Diff against target: 40 lines (+7/-6)
2 files modified
data/recoverable_problem (+3/-4)
test/test_recoverable_problem.py (+4/-2)
To merge this branch: bzr merge lp:~brian-murray/apport/recoverable-problem-dupesig
Reviewer Review Type Date Requested Status
Martin Pitt (community) Approve
Review via email: mp+256395@code.launchpad.net

Description of the change

Really create a better duplicate signature using ExecutablePath fixing bug 1316763.

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

Thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'data/recoverable_problem'
--- data/recoverable_problem 2014-10-13 20:32:11 +0000
+++ data/recoverable_problem 2015-04-15 20:43:11 +0000
@@ -62,10 +62,9 @@
62 report.add_user_info()62 report.add_user_info()
6363
64 ds = report.get('DuplicateSignature', '')64 ds = report.get('DuplicateSignature', '')
65 package = report.get('Package', '')65 exec_path = report.get('ExecutablePath', '')
66 if package and ds:66 if exec_path and ds:
67 package = package.split()[0]67 report['DuplicateSignature'] = '%s:%s' % (exec_path, ds)
68 report['DuplicateSignature'] = '%s:%s' % (package, ds)
6968
70 # Write the final report69 # Write the final report
71 with open(apport.fileutils.make_report_path(report), 'wb') as fp:70 with open(apport.fileutils.make_report_path(report), 'wb') as fp:
7271
=== modified file 'test/test_recoverable_problem.py'
--- test/test_recoverable_problem.py 2014-05-14 20:58:42 +0000
+++ test/test_recoverable_problem.py 2015-04-15 20:43:11 +0000
@@ -59,14 +59,16 @@
59 self.assertTrue('Pid:\t%d' % os.getpid() in report['ProcStatus'])59 self.assertTrue('Pid:\t%d' % os.getpid() in report['ProcStatus'])
6060
61 def test_recoverable_problem_dupe_sig(self):61 def test_recoverable_problem_dupe_sig(self):
62 '''recoverable_problem duplicate signature includes package'''62 '''recoverable_problem duplicate signature includes ExecutablePath'''
6363
64 self.call_recoverable_problem('Package\0test\0DuplicateSignature\0ds')64 self.call_recoverable_problem('Package\0test\0DuplicateSignature\0ds')
65 path = self.wait_for_report()65 path = self.wait_for_report()
66 with open(path, 'rb') as report_path:66 with open(path, 'rb') as report_path:
67 report = apport.report.Report()67 report = apport.report.Report()
68 report.load(report_path)68 report.load(report_path)
69 self.assertEqual(report['DuplicateSignature'], 'test:ds')69 exec_path = report.get('ExecutablePath')
70 self.assertEqual(report['DuplicateSignature'], '%s:ds' %
71 (exec_path))
70 self.assertTrue('Pid:\t%d' % os.getpid() in report['ProcStatus'])72 self.assertTrue('Pid:\t%d' % os.getpid() in report['ProcStatus'])
7173
72 def test_invalid_data(self):74 def test_invalid_data(self):

Subscribers

People subscribed via source and target branches