Merge lp:~glatzor/aptdaemon/maverik-updates into lp:ubuntu/maverick-updates/aptdaemon

Proposed by Sebastian Heinlein
Status: Merged
Merged at revision: 50
Proposed branch: lp:~glatzor/aptdaemon/maverik-updates
Merge into: lp:ubuntu/maverick-updates/aptdaemon
Diff against target: 142 lines (+122/-0)
3 files modified
debian/changelog (+15/-0)
debian/patches/10_improve_error_reporting.patch (+106/-0)
debian/patches/series (+1/-0)
To merge this branch: bzr merge lp:~glatzor/aptdaemon/maverik-updates
Reviewer Review Type Date Requested Status
Michael Vogt Pending
Review via email: mp+47067@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Sebastian Heinlein (glatzor) wrote :

Hello Michael,

The changes would allow me to gather more information about common exceptions in aptdaemon. It would be of great help to have it in maverick-updates soon.

Cheers,

Sebastian

Revision history for this message
Michael Vogt (mvo) wrote :

On Fri, Jan 21, 2011 at 09:20:21PM -0000, Sebastian Heinlein wrote:
> Hello Michael,
>
> The changes would allow me to gather more information about common exceptions in aptdaemon. It would be of great help to have it in maverick-updates soon.

Many thanks! I uploaded this to maverick-proposed now (had to fix the
prefix level of the patch for quilt, but otherwise no issues).

Thanks,
 michael

> Cheers,
>
> Sebastian
> --
> https://code.launchpad.net/~glatzor/aptdaemon/maverik-updates/+merge/47067
> You are requested to review the proposed merge of lp:~glatzor/aptdaemon/maverik-updates into lp:ubuntu/maverick-updates/aptdaemon.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/changelog'
--- debian/changelog 2010-12-11 11:00:50 +0000
+++ debian/changelog 2011-01-21 18:23:27 +0000
@@ -1,3 +1,18 @@
1aptdaemon (0.31+bzr506-0ubuntu6) maverick-proposed; urgency=low
2
3 * debian/patches/10_improve_error_reporting.patch:
4 - There are currently three errors which don't provide enough information
5 to be fixed:
6 Sometimes installation of local package files fails. This patch raises a
7 PACKAGE_MANAGER_FAILED error instead of an unknown one in this case and
8 adds the output of the dpkg call to the error (e.g. LP: #665722).
9 Furthermore the TransactionFailed exception doesn't show the
10 details and the code by default (LP: #665218).
11 The message of lock.LockFailedError doesn't contain the lock file path
12 and the blocking process (LP: #665572).
13
14 -- Sebastian Heinlein <devel@glatzor.de> Fri, 21 Jan 2011 15:00:59 +0100
15
1aptdaemon (0.31+bzr506-0ubuntu5) maverick-proposed; urgency=low16aptdaemon (0.31+bzr506-0ubuntu5) maverick-proposed; urgency=low
217
3 * debian/patches/09_fix_index_race_659438.patch:18 * debian/patches/09_fix_index_race_659438.patch:
419
=== added file 'debian/patches/10_improve_error_reporting.patch'
--- debian/patches/10_improve_error_reporting.patch 1970-01-01 00:00:00 +0000
+++ debian/patches/10_improve_error_reporting.patch 2011-01-21 18:23:27 +0000
@@ -0,0 +1,106 @@
1Description: Provide more error details
2 There are currently three errors which don't provide enough information
3 to be fixed:
4 Sometimes installation of local package files fails. This patch raises a
5 PACKAGE_MANAGER_FAILED error instead of an unknown one in this case and
6 adds the output of the dpkg call to the error (e.g. LP: #665722).
7 Furthermore the TransactionFailed exception doesn't show the
8 details and the code by default (LP: #665218).
9 The message of lock.LockFailedError doesn't contain the lock file path
10 and the blocking process (LP: #665572).
11Author: Sebastian Heinlein <devel@glatzor.de>
12Origin: other
13=== modified file 'aptdaemon/core.py'
14--- aptdaemon/core.py 2010-09-16 09:11:50 +0000
15+++ aptdaemon/core.py 2011-01-21 14:13:38 +0000
16@@ -202,6 +202,7 @@
17 self._sender_owner_changed)
18 else:
19 self._sender_watch = None
20+ self.output = ""
21
22 def _sender_owner_changed(self, connection):
23 """Callback if the owner of the original sender changed, e.g.
24
25=== modified file 'aptdaemon/errors.py'
26--- aptdaemon/errors.py 2010-08-24 09:00:36 +0000
27+++ aptdaemon/errors.py 2011-01-21 14:05:05 +0000
28@@ -30,6 +30,8 @@
29 import dbus
30 from functools import wraps
31
32+import aptdaemon.enums
33+
34
35 class AptDaemonError(dbus.DBusException):
36
37@@ -70,6 +72,11 @@
38 self.code = code
39 self.details = details
40
41+ def __str__(self):
42+ return "Transaction failed: %s\n%s" % \
43+ (aptdaemon.enums.get_role_error_from_enum(self.code),
44+ self.details)
45+
46
47 class InvalidMetaDataError(AptDaemonError):
48
49
50=== modified file 'aptdaemon/lock.py'
51--- aptdaemon/lock.py 2010-12-11 11:00:50 +0000
52+++ aptdaemon/lock.py 2011-01-21 17:58:58 +0000
53@@ -40,7 +40,11 @@
54 flock -- the path of the file lock
55 process -- the process which holds the lock or None
56 """
57- Exception.__init__(self)
58+ if process:
59+ msg = "%s is already locked by %s" % (flock, process)
60+ else:
61+ msg = "Failed to lock %s" % flock
62+ Exception.__init__(self, msg)
63 self.flock = flock
64 self.process = process
65
66
67=== modified file 'aptdaemon/worker.py'
68--- aptdaemon/worker.py 2010-12-11 11:00:50 +0000
69+++ aptdaemon/worker.py 2011-01-21 14:30:50 +0000
70@@ -463,9 +463,12 @@
71 self._commit_changes(fetch_range=(5, 33),
72 install_range=(34, 63))
73 # Install the dpkg file
74- if deb.install(DaemonDpkgInstallProgress(self.trans,
75- begin=64, end=95)):
76- raise TransactionFailed(ERROR_UNKNOWN, deb._failure_string)
77+ deb_progress = DaemonDpkgInstallProgress(self.trans, begin=64, end=95)
78+ res = deb.install(deb_progress)
79+ self.trans.output += deb_progress.output.decode("UTF-8", "ignore")
80+ if res:
81+ raise TransactionFailed(ERROR_PACKAGE_MANAGER_FAILED,
82+ self.trans.output)
83
84 def remove_packages(self, package_names):
85 """Remove packages.
86@@ -627,6 +630,7 @@
87 progress.start_update()
88 progress.run()
89 progress.finish_update()
90+ self.trans.output += progress.output.decode("UTF-8", "ignore")
91 if progress._child_exit != 0:
92 raise TransactionFailed(ERROR_PACKAGE_MANAGER_FAILED,
93 progress.output)
94@@ -749,8 +753,11 @@
95 progress.run()
96 progress.finish_update()
97 output = inst_progress.output + progress.output
98+ self.trans.output += output.decode("UTF-8", "ignore")
99 raise TransactionFailed(ERROR_PACKAGE_MANAGER_FAILED,
100 "%s: %s" % (excep, output))
101+ else:
102+ self.trans.output += inst_progress.output.decode("UTF-8", "ignore")
103
104 def simulate(self, trans, status_path=None):
105 """Return the dependencies which will be installed by the transaction,
106
0107
=== modified file 'debian/patches/series'
--- debian/patches/series 2010-12-11 11:00:50 +0000
+++ debian/patches/series 2011-01-21 18:23:27 +0000
@@ -3,3 +3,4 @@
307_fix-race-597017.patch307_fix-race-597017.patch
408_fix_deb_install.patch408_fix_deb_install.patch
509_fix_index_race_659438.patch509_fix_index_race_659438.patch
610_improve_error_reporting.patch

Subscribers

People subscribed via source and target branches