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

Subscribers

People subscribed via source and target branches