Comment 9 for bug 1872551

Revision history for this message
Hans P. Möller (hmollercl) wrote :

could you test adding this to /lib/python3/dist-packages/softwareproperties/qt/SoftwarePropertiesQt.py SoftwarePropertiesQt.py ? For me testing with nvidia is not easy

--- /lib/python3/dist-packages/softwareproperties/qt/SoftwarePropertiesQt.py 2020-04-14 09:16:19.370592334 -0400
+++ SoftwarePropertiesQt.py 2020-04-14 09:02:21.894527421 -0400
@@ -78,6 +78,17 @@
       QWidget.__init__(self)
       uic.loadUi("%s/designer/main.ui" % datadir, self)

+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 SoftwarePropertiesQt(SoftwareProperties):
   def __init__(self, datadir=None, options=None, parent=None, file=None, attachWinID=None):
     """ Provide a Qt-based graphical user interface to configure