[packagekit] [PATCH] apt: handle inconsistent source repo state.

James Westby jw+debian at jameswestby.net
Wed Sep 10 11:37:21 PDT 2008


If deb-src lines aren't available for every deb line then
softwareproperties will report it as inconsistent, with
None. The apt backend tried to pass this directly as
the "enabled" parameter, which fails as it should be able to
be considered an integer. We instead substitute False.

Thanks to Baptiste Mille-Mathias for reporting and testing.
---
 backends/apt/aptDBUSBackend.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

  Sebastian, is "False" the correct thing to use here? Should
  it be "True" instead?

diff --git a/backends/apt/aptDBUSBackend.py b/backends/apt/aptDBUSBackend.py
index 2cfe72d..79fe73b 100755
--- a/backends/apt/aptDBUSBackend.py
+++ b/backends/apt/aptDBUSBackend.py
@@ -827,7 +827,7 @@ class PackageKitAptBackend(PackageKitBaseBackend):
         # Emit distro's virtual source code repositoriy
         if not FILTER_NOT_DEVELOPMENT in filter_list:
             repo_id = "%s_source" % repos.distro.id
-            enabled = repos.get_source_code_state()
+            enabled = repos.get_source_code_state() or False
             #FIXME: no translation :(
             description = "%s %s - Source code" % (repos.distro.id, 
                                                    repos.distro.release)
-- 
1.5.6.3



More information about the PackageKit mailing list