Merge lp:~evfool/aptdaemon/fixoverflow into lp:aptdaemon

Proposed by Robert Roth
Status: Merged
Merged at revision: 662
Proposed branch: lp:~evfool/aptdaemon/fixoverflow
Merge into: lp:aptdaemon
Diff against target: 72 lines (+9/-7)
2 files modified
aptdaemon/core.py (+7/-5)
doc/source/dbus.rst (+2/-2)
To merge this branch: bzr merge lp:~evfool/aptdaemon/fixoverflow
Reviewer Review Type Date Requested Status
Michael Vogt Approve
Aptdaemon Developers Pending
Review via email: mp+65943@code.launchpad.net

Description of the change

I am proposing to change the type of the Download and Space transaction properties from Int32 to Int64, to reduce the number of OverflowErrors happening with large Installed-Size properties from control files (see bug #771678 and bug #758837). I have made the changes, changed the API docs to match it, and I have tested the solution with test_worker.py and test_dbus_types, and all tests were successful. Also tested installing a package which failed to install before the fix due to an OverflowError, and after the fix, it has been installed successfully.

To post a comment you must log in.
Revision history for this message
Michael Vogt (mvo) wrote :

This looks fine to me. I'm happy to merge this into trunk if Sebastian has no objections.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'aptdaemon/core.py'
2--- aptdaemon/core.py 2011-04-15 08:16:25 +0000
3+++ aptdaemon/core.py 2011-06-27 08:18:28 +0000
4@@ -174,6 +174,8 @@
5 attrib["type"] = "s"
6 elif isinstance(value, dbus.Int32):
7 attrib["type"] = "i"
8+ elif isinstance(value, dbus.Int64):
9+ attrib["type"] = "x"
10 elif isinstance(value, dbus.Boolean):
11 attrib["type"] = "b"
12 elif isinstance(value, dbus.Struct):
13@@ -183,7 +185,7 @@
14 elif isinstance(value, dbus.Array):
15 attrib["type"] = "a%s" % value.signature
16 else:
17- raise Exception("Type %s of property %s in't " \
18+ raise Exception("Type %s of property %s isn't " \
19 "convertable" % (type(value), key))
20 iface.append(ElementTree.Element("property", attrib))
21 new_data = ElementTree.tostring(xml, encoding="UTF-8")
22@@ -345,8 +347,8 @@
23 self.cancelled = dbus.Boolean(False)
24 self.paused = dbus.Boolean(False)
25 self._meta_data = dbus.Dictionary(signature="sv")
26- self._download = dbus.Int32(0)
27- self._space = dbus.Int32(0)
28+ self._download = dbus.Int64(0)
29+ self._space = dbus.Int64(0)
30 self._depends = dbus.Struct([dbus.Array([], signature='s') \
31 for i in range(7)],
32 signature="asasasasasasas")
33@@ -497,7 +499,7 @@
34 return self._download
35
36 def _set_download(self, size):
37- self._download = dbus.Int32(size)
38+ self._download = dbus.Int64(size)
39 self.PropertyChanged("Download", self._download)
40
41 download = property(_get_download, _set_download,
42@@ -507,7 +509,7 @@
43 return self._space
44
45 def _set_space(self, size):
46- self._space = dbus.Int32(size)
47+ self._space = dbus.Int64(size)
48 self.PropertyChanged("Space", self._space)
49
50 space = property(_get_space, _set_space,
51
52=== modified file 'doc/source/dbus.rst'
53--- doc/source/dbus.rst 2011-02-19 13:40:03 +0000
54+++ doc/source/dbus.rst 2011-06-27 08:18:28 +0000
55@@ -203,7 +203,7 @@
56
57 *read-only*
58
59-.. attribute:: Download : i
60+.. attribute:: Download : x
61
62 The required download size in Bytes.
63
64@@ -331,7 +331,7 @@
65 ``role-install-packages``.
66 *read-only*
67
68-.. attribute:: Space : i
69+.. attribute:: Space : x
70
71 The required disk space in Bytes. If disk spaces is freed the value will
72 be negative.

Subscribers

People subscribed via source and target branches

to status/vote changes: