Merge lp:~mvo/aptdaemon/fix-702217 into lp:aptdaemon

Proposed by Michael Vogt
Status: Merged
Approved by: Michael Vogt
Approved revision: 595
Merge reported by: Michael Vogt
Merged at revision: not available
Proposed branch: lp:~mvo/aptdaemon/fix-702217
Merge into: lp:aptdaemon
Diff against target: 48 lines (+14/-3)
2 files modified
aptdaemon/core.py (+2/-3)
tests/test_worker.py (+12/-0)
To merge this branch: bzr merge lp:~mvo/aptdaemon/fix-702217
Reviewer Review Type Date Requested Status
Sebastian Heinlein Disapprove
Review via email: mp+52435@code.launchpad.net

Description of the change

This is a fix for bug #702217. It also adds a testcase (that fails with the old code).

The fix by ckorn is probably fine as well (haven't tested it).

To post a comment you must log in.
Revision history for this message
Sebastian Heinlein (glatzor) wrote :

Instead of changing the types I prefer removing the item assignment. Fixed in rev. 595. Thanks a lot!

Revision history for this message
Sebastian Heinlein (glatzor) :
review: Disapprove
Revision history for this message
Michael Vogt (mvo) wrote :

I mark it as merged to get it off the code.launchpad.net list, its not merged as such, but the test is in and the bug is fixed (in a different way though).

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-02-19 13:40:03 +0000
3+++ aptdaemon/core.py 2011-03-07 17:16:01 +0000
4@@ -340,9 +340,8 @@
5 self._depends = dbus.Struct([dbus.Array([], signature='s') \
6 for i in range(7)],
7 signature="asasasasasasas")
8- self._packages = dbus.Struct([dbus.Array(pkgs, signature="s")
9- for pkgs in packages],
10- signature="asasasasasas")
11+ self._packages = dbus.Array([dbus.Array(pkgs, signature="s")
12+ for pkgs in packages])
13 self._unauthenticated = dbus.Array([], signature=dbus.Signature('s'))
14 # Add a timeout which removes the transaction from the bus if it
15 # hasn't been setup and run for the TRANSACTION_IDLE_TIMEOUT period
16
17=== added directory 'tests/debs'
18=== added file 'tests/debs/utf8-package_1.0-1_all.deb'
19Binary files tests/debs/utf8-package_1.0-1_all.deb 1970-01-01 00:00:00 +0000 and tests/debs/utf8-package_1.0-1_all.deb 2011-03-07 17:16:01 +0000 differ
20=== modified file 'tests/test_worker.py'
21--- tests/test_worker.py 2011-02-07 08:11:22 +0000
22+++ tests/test_worker.py 2011-03-07 17:16:01 +0000
23@@ -35,6 +35,7 @@
24 from aptdaemon import enums, errors
25
26 REPO_PATH = os.path.join(aptdaemon.test.get_tests_dir(), "repo")
27+DEBS_PATH = os.path.join(aptdaemon.test.get_tests_dir(), "debs")
28
29
30 class MockQueue(object):
31@@ -256,6 +257,17 @@
32 self.worker._cache.open()
33 self.assertTrue(self.worker._cache["silly-depend-base"].is_installed)
34
35+ def test_install_file_not_known_to_cache(self):
36+ """ this tests that a local deb file (that is not known to the cache)
37+ can be installed
38+ """
39+ pkg = os.path.join(DEBS_PATH, "utf8-package_1.0-1_all.deb")
40+ trans = Transaction(enums.ROLE_INSTALL_FILE, self.queue, os.getuid(),
41+ "org.debian.apt.test", bus=self.dbus,
42+ kwargs={"path": os.path.join(REPO_PATH, pkg),
43+ "force": True})
44+ self.worker.simulate(trans)
45+
46 def test_fix_broken_depends(self):
47 """Test the fixing of broken dependencies."""
48 for pkg in ["silly-base_0.1-0_all.deb", "silly-broken_0.1-0_all.deb"]:

Subscribers

People subscribed via source and target branches

to status/vote changes: