diff -Nru software-properties-0.98.7/debian/changelog software-properties-0.98.9/debian/changelog --- software-properties-0.98.7/debian/changelog 2020-02-27 14:38:46.000000000 +0000 +++ software-properties-0.98.9/debian/changelog 2020-04-16 09:57:50.000000000 +0000 @@ -1,3 +1,21 @@ +software-properties (0.98.9) focal; urgency=medium + + * softwareproperties/gtk/SoftwarePropertiesGtk.py: + - Gtk is doing something that takes a lock while processing checkbox + toggled events, the polkit auth dialog can't be displayed in return, + we don't have a proper fix and it might require GTK changes, + meanwhile we want a working interface so workaround with a sleep + (lp: #1727908) + + -- Sebastien Bacher Thu, 16 Apr 2020 11:57:50 +0200 + +software-properties (0.98.8) focal; urgency=medium + + * Move get_dependencies from SoftwarePropertiesGtk to SoftwareProperties + and adjust both Qt and Gtk frontends to use that (LP: #1872551) + + -- Julian Andres Klode Thu, 16 Apr 2020 10:41:28 +0200 + software-properties (0.98.7) focal; urgency=medium * softwareproperties/gtk/SimpleGtkbuilderApp.py: Fix a typo in the diff -Nru software-properties-0.98.7/softwareproperties/gtk/SoftwarePropertiesGtk.py software-properties-0.98.9/softwareproperties/gtk/SoftwarePropertiesGtk.py --- software-properties-0.98.7/softwareproperties/gtk/SoftwarePropertiesGtk.py 2020-02-27 14:38:46.000000000 +0000 +++ software-properties-0.98.9/softwareproperties/gtk/SoftwarePropertiesGtk.py 2020-04-16 09:57:50.000000000 +0000 @@ -38,6 +38,7 @@ import logging import threading import sys +import time import gi gi.require_version("Gdk", "3.0") @@ -144,18 +145,6 @@ return False -def get_dependencies(apt_cache, package_name, pattern=None): - """ Get the package dependencies, which can be filtered out by a pattern """ - dependencies = [] - for or_group in apt_cache[package_name].candidate.dependencies: - for dep in or_group: - if dep.rawtype in ["Depends", "PreDepends"]: - dependencies.append(dep.name) - if pattern: - dependencies = [ x for x in dependencies if x.find(pattern) != -1 ] - return dependencies - - class SoftwarePropertiesGtk(SoftwareProperties, SimpleGtkbuilderApp): def __init__(self, datadir=None, options=None, file=None, parent=None): @@ -847,6 +836,13 @@ def on_isv_source_toggled(self, cell_toggle, path, store): """Enable or disable the selected channel""" + + #FIXME Gtk is doing something that takes a lock while processing + # the events, the polkit auth dialog can't be displayed in return, + # we don't have a proper fix and it might require GTK changes, + # meanwhile we want a working interface so workaround with a sleep + # https://launchpad.net/bugs/1727908 + time.sleep(0.3) #FIXME cdroms need to disable the comps in the childs and sources iter = store.get_iter((int(path),)) source_entry = store.get_value(iter, STORE_SOURCE) @@ -1193,7 +1189,7 @@ # We need to collect its dependencies, so that # we can uninstall the driver properly. if 'nvidia' in pkg.shortname: - for dep in get_dependencies(self.apt_cache, pkg.shortname, 'nvidia'): + for dep in self.get_dependencies(self.apt_cache, pkg.shortname, 'nvidia'): dep_pkg = self.apt_cache[dep] if dep_pkg.is_installed: removals.append(self.get_package_id(dep_pkg.installed)) diff -Nru software-properties-0.98.7/softwareproperties/qt/SoftwarePropertiesQt.py software-properties-0.98.9/softwareproperties/qt/SoftwarePropertiesQt.py --- software-properties-0.98.7/softwareproperties/qt/SoftwarePropertiesQt.py 2020-02-27 14:38:46.000000000 +0000 +++ software-properties-0.98.9/softwareproperties/qt/SoftwarePropertiesQt.py 2020-04-16 08:41:28.000000000 +0000 @@ -892,7 +892,7 @@ # We need to collect its dependencies, so that # we can uninstall the driver properly. if 'nvidia' in pkg.shortname: - for dep in get_dependencies(self.apt_cache, pkg.shortname, 'nvidia'): + for dep in self.get_dependencies(self.apt_cache, pkg.shortname, 'nvidia'): dep_pkg = self.apt_cache[dep] if dep_pkg.is_installed: removals.append(self.get_package_id(dep_pkg.installed)) diff -Nru software-properties-0.98.7/softwareproperties/SoftwareProperties.py software-properties-0.98.9/softwareproperties/SoftwareProperties.py --- software-properties-0.98.7/softwareproperties/SoftwareProperties.py 2020-02-27 14:38:46.000000000 +0000 +++ software-properties-0.98.9/softwareproperties/SoftwareProperties.py 2020-04-16 08:41:28.000000000 +0000 @@ -866,6 +866,19 @@ return "%s;%s;%s;" % (ver.package.shortname, ver.version, ver.package.architecture()) + + @staticmethod + def get_dependencies(apt_cache, package_name, pattern=None): + """ Get the package dependencies, which can be filtered out by a pattern """ + dependencies = [] + for or_group in apt_cache[package_name].candidate.dependencies: + for dep in or_group: + if dep.rawtype in ["Depends", "PreDepends"]: + dependencies.append(dep.name) + if pattern: + dependencies = [ x for x in dependencies if x.find(pattern) != -1 ] + return dependencies + def shortcut_handler(shortcut): for factory in _SHORTCUT_FACTORIES: ret = factory(shortcut)