Merge lp:~mvo/software-center/lp1051829 into lp:software-center

Proposed by Michael Vogt
Status: Merged
Merged at revision: 3225
Proposed branch: lp:~mvo/software-center/lp1051829
Merge into: lp:software-center
Diff against target: 42 lines (+13/-1)
2 files modified
softwarecenter/backend/installbackend_impl/aptd.py (+5/-0)
tests/test_aptd.py (+8/-1)
To merge this branch: bzr merge lp:~mvo/software-center/lp1051829
Reviewer Review Type Date Requested Status
software-store-developers Pending
Review via email: mp+128190@code.launchpad.net

Description of the change

This branch stops reporting errors about bad-quality deb packages as
there are too many of them in the wild and we know that already ;)

This fixes the largest source of recoverable reports from #1051829

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'softwarecenter/backend/installbackend_impl/aptd.py'
2--- softwarecenter/backend/installbackend_impl/aptd.py 2012-10-02 16:23:45 +0000
3+++ softwarecenter/backend/installbackend_impl/aptd.py 2012-10-05 08:53:20 +0000
4@@ -1019,6 +1019,11 @@
5 # ... and display as a dialog
6 self.ui.error(None, summary, text)
7 return
8+
9+ # lintian errors are ignored and not send to apport_recoverable_error
10+ if trans.error_code == enums.ERROR_INVALID_PACKAGE_FILE:
11+ return
12+
13 # show a apport recoverable error dialog to the user as we want
14 # to know about these issues
15 self._call_apport_recoverable_error(
16
17=== modified file 'tests/test_aptd.py'
18--- tests/test_aptd.py 2012-09-18 09:21:16 +0000
19+++ tests/test_aptd.py 2012-10-05 08:53:20 +0000
20@@ -24,7 +24,7 @@
21 from defer import inline_callbacks
22 from mock import Mock, patch
23
24-import aptdaemon.loop
25+import aptdaemon
26
27
28 class TestAptdaemon(unittest.TestCase):
29@@ -169,6 +169,13 @@
30 kwargs["input"].split("\0"),
31 [ 'DialogBody', 'msg','Traceback', 'traceback-error'])
32
33+ def test_ignore_bad_packages(self):
34+ mock_trans = Mock(aptdaemon.client.AptTransaction)
35+ mock_trans.error_code = aptdaemon.enums.ERROR_INVALID_PACKAGE_FILE
36+ with patch.object(self.aptd, "_call_apport_recoverable_error") as m:
37+ self.aptd._on_trans_error("some error", mock_trans)
38+ self.assertFalse(m.called)
39+
40
41 if __name__ == "__main__":
42 logging.basicConfig(level=logging.INFO)

Subscribers

People subscribed via source and target branches