Merge ~albertomilone/ubuntu/+source/software-properties:apt-pkg-transition into ubuntu/+source/software-properties:ubuntu/devel

Proposed by Alberto Milone
Status: Needs review
Proposed branch: ~albertomilone/ubuntu/+source/software-properties:apt-pkg-transition
Merge into: ubuntu/+source/software-properties:ubuntu/devel
Diff against target: 406 lines (+121/-80)
3 files modified
softwareproperties/SoftwareProperties.py (+24/-12)
softwareproperties/gtk/SoftwarePropertiesGtk.py (+49/-35)
softwareproperties/qt/SoftwarePropertiesQt.py (+48/-33)
Reviewer Review Type Date Requested Status
Sebastien Bacher (community) Approve
Julian Andres Klode (community) Needs Fixing
git-ubuntu import Pending
Review via email: mp+416950@code.launchpad.net

Commit message

This makes software-properties{gtk|qt} compatible with the new ubuntu-drivers-common, and its new apt_pkg code.

To post a comment you must log in.
Revision history for this message
Matthew Ruffell (mruffell) wrote :

Hi Alberto,

I tried to build and test your patch, but it fails on the pyflakes3 test:

$ python3 tests/test_pyflakes.py
/home/matthew/Work/lp1964880/alberto/software-properties/softwareproperties/SoftwareProperties.py:29:1 'apt' imported but unused
/home/matthew/Work/lp1964880/alberto/software-properties/softwareproperties/SoftwareProperties.py:753:9 redefinition of unused 'apt' from line 29
E
======================================================================
ERROR: test_pyflakes3_clean (__main__.TestPyflakesClean)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/matthew/Work/lp1964880/alberto/software-properties/tests/test_pyflakes.py", line 21, in test_pyflakes3_clean
    self.assertEqual(subprocess.check_call(['pyflakes3'] + self.paths), 0)
  File "/usr/lib/python3.10/subprocess.py", line 369, in check_call
    raise CalledProcessError(retcode, cmd)

Revision history for this message
Julian Andres Klode (juliank) wrote :

I found a couple of spots worth fixing/considering in the diff

review: Needs Fixing
68577e2... by Alberto Milone

softwareproperties/SoftwareProperties.py: import apt only on demand

66473bd... by Alberto Milone

Do without a couple of tries, and make get_package_id return the installed package when available

Revision history for this message
Alberto Milone (albertomilone) wrote :

I have just pushed a couple of commits which should fix the problems reported by Julian and Matthew. Thanks

Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks, I've merged and uploaded but I can't close that one since it's targetting the wrong Vcs, for reference the git repository is reference in debian/control and https://git.launchpad.net/software-properties

I've also updated the depends on ubuntu-drivers-common since the updated code would error out with a pre-apt-refactoring version of the drivers

review: Approve
Revision history for this message
Alberto Milone (albertomilone) wrote :

I understand. Sorry about that. Thanks

Unmerged commits

66473bd... by Alberto Milone

Do without a couple of tries, and make get_package_id return the installed package when available

68577e2... by Alberto Milone

softwareproperties/SoftwareProperties.py: import apt only on demand

ada2244... by Alberto Milone

Use apt_pkg instead of apt, as in ubuntu-drivers-common

Fixes LP: #1964880

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/softwareproperties/SoftwareProperties.py b/softwareproperties/SoftwareProperties.py
index 3e94731..7fc9862 100644
--- a/softwareproperties/SoftwareProperties.py
+++ b/softwareproperties/SoftwareProperties.py
@@ -26,7 +26,6 @@
26from __future__ import absolute_import, print_function26from __future__ import absolute_import, print_function
2727
28import apt_pkg28import apt_pkg
29import apt
30import copy29import copy
31from hashlib import md530from hashlib import md5
32import re31import re
@@ -828,22 +827,35 @@ class SoftwareProperties(object):
828 except:827 except:
829 return False828 return False
830829
831 def get_package_id(self, ver):830 def get_package_id(self, apt_cache, pkg):
832 """ Return the PackageKit package id """831 """ Return the PackageKit package id """
833 assert isinstance(ver, apt.package.Version)832 assert isinstance(pkg, apt_pkg.Package)
834 return "%s;%s;%s;" % (ver.package.shortname, ver.version,833 cur_ver = pkg.current_ver
835 ver.package.architecture())834 if cur_ver:
835 ver = cur_ver.ver_str
836 arch = cur_ver.arch
837 else:
838 depcache = apt_pkg.DepCache(apt_cache)
839 candidate = depcache.get_candidate_ver(pkg)
840 ver = candidate.ver_str
841 arch = candidate.arch
842 return "%s;%s;%s;" % (pkg.name, ver, arch)
836843
837 @staticmethod844 @staticmethod
838 def get_dependencies(apt_cache, package_name, pattern=None):845 def get_dependencies(apt_cache, package, pattern=None):
839 """ Get the package dependencies, which can be filtered out by a pattern """846 """ Get the package dependencies, which can be filtered out by a pattern """
847 depcache = apt_pkg.DepCache(apt_cache)
848 candidate = depcache.get_candidate_ver(package)
849
840 dependencies = []850 dependencies = []
841 for or_group in apt_cache[package_name].candidate.dependencies:851 try:
842 for dep in or_group:852 for dep_list in candidate.depends_list_str.get('Depends'):
843 if dep.rawtype in ["Depends", "PreDepends"]:853 for dep_name, dep_ver, dep_op in dep_list:
844 dependencies.append(dep.name)854 if dep_name.find(pattern) != -1:
845 if pattern:855 dependencies.append(apt_cache[dep_name])
846 dependencies = [ x for x in dependencies if x.find(pattern) != -1 ]856 except (KeyError, TypeError):
857 return []
858
847 return dependencies859 return dependencies
848860
849861
diff --git a/softwareproperties/gtk/SoftwarePropertiesGtk.py b/softwareproperties/gtk/SoftwarePropertiesGtk.py
index 9b797ac..01e3d28 100644
--- a/softwareproperties/gtk/SoftwarePropertiesGtk.py
+++ b/softwareproperties/gtk/SoftwarePropertiesGtk.py
@@ -26,7 +26,6 @@
2626
27from __future__ import absolute_import, print_function27from __future__ import absolute_import, print_function
2828
29import apt
30import apt_pkg29import apt_pkg
31import datetime30import datetime
32import dbus31import dbus
@@ -228,7 +227,9 @@ class SoftwarePropertiesGtk(SoftwareProperties, SimpleGtkbuilderApp):
228 # used to store the handlers of callbacks227 # used to store the handlers of callbacks
229 self.handlers = {}228 self.handlers = {}
230229
231 self.apt_cache = {}230 # Initialise and store the apt cache
231 self.init_apt_cache()
232
232 self.pk_task = None233 self.pk_task = None
233234
234 # Put some life into the user interface:235 # Put some life into the user interface:
@@ -290,6 +291,17 @@ class SoftwarePropertiesGtk(SoftwareProperties, SimpleGtkbuilderApp):
290 self.handlers[self.combobox_release_upgrades] = \291 self.handlers[self.combobox_release_upgrades] = \
291 self.combobox_release_upgrades.connect("changed", 292 self.combobox_release_upgrades.connect("changed",
292 self.on_combobox_release_upgrades_changed)293 self.on_combobox_release_upgrades_changed)
294 def init_apt_cache(self):
295 apt_pkg.init_config()
296 apt_pkg.init_system()
297 self.apt_cache = apt_pkg.Cache(None)
298 self.depcache = apt_pkg.DepCache(self.apt_cache)
299 self.records = apt_pkg.PackageRecords(self.apt_cache)
300
301 def update_apt_cache(self):
302 self.apt_cache = apt_pkg.Cache(None)
303 self.depcache = apt_pkg.DepCache(self.apt_cache)
304 self.records = apt_pkg.PackageRecords(self.apt_cache)
293305
294 def init_auto_update(self):306 def init_auto_update(self):
295 """ Set up the widgets that allow to configure the update automation """307 """ Set up the widgets that allow to configure the update automation """
@@ -983,7 +995,7 @@ class SoftwarePropertiesGtk(SoftwareProperties, SimpleGtkbuilderApp):
983 # dbus events995 # dbus events
984 def on_config_modified(self):996 def on_config_modified(self):
985 """The config was changed and now needs to be saved and reloaded"""997 """The config was changed and now needs to be saved and reloaded"""
986 apt.apt_pkg.init_config()998 apt_pkg.init_config()
987 self.button_revert.set_sensitive(True)999 self.button_revert.set_sensitive(True)
9881000
989 def on_keys_modified(self):1001 def on_keys_modified(self):
@@ -1226,7 +1238,7 @@ class SoftwarePropertiesGtk(SoftwareProperties, SimpleGtkbuilderApp):
1226 if not installs_pending:1238 if not installs_pending:
1227 self.progress_bar.set_visible(False)1239 self.progress_bar.set_visible(False)
1228 self.clear_changes()1240 self.clear_changes()
1229 self.apt_cache = apt.Cache()1241 self.update_apt_cache()
1230 self.set_driver_action_status()1242 self.set_driver_action_status()
1231 self.update_label_and_icons_from_status()1243 self.update_label_and_icons_from_status()
1232 self.button_driver_revert.set_visible(True)1244 self.button_driver_revert.set_visible(True)
@@ -1239,19 +1251,20 @@ class SoftwarePropertiesGtk(SoftwareProperties, SimpleGtkbuilderApp):
1239 installs = []1251 installs = []
1240 removals = []1252 removals = []
12411253
1254 has_nvidia = False
1242 for pkg in self.driver_changes:1255 for pkg in self.driver_changes:
1243 if pkg.is_installed:1256 if pkg.current_ver:
1244 removals.append(self.get_package_id(pkg.installed))1257 removals.append(self.get_package_id(self.apt_cache, pkg))
1245 # The main NVIDIA package is only a metapackage.1258 # The main NVIDIA package is only a metapackage.
1246 # We need to collect its dependencies, so that1259 # We need to collect its dependencies, so that
1247 # we can uninstall the driver properly.1260 # we can uninstall the driver properly.
1248 if 'nvidia' in pkg.shortname:1261 if 'nvidia' in pkg.name:
1249 for dep in self.get_dependencies(self.apt_cache, pkg.shortname, 'nvidia'):1262 has_nvidia = True
1250 dep_pkg = self.apt_cache[dep]1263 for dep in self.get_dependencies(self.apt_cache, pkg, 'nvidia'):
1251 if dep_pkg.is_installed:1264 if dep.current_ver:
1252 removals.append(self.get_package_id(dep_pkg.installed))1265 removals.append(self.get_package_id(self.apt_cache, dep))
1253 else:1266 else:
1254 installs.append(self.get_package_id(pkg.candidate))1267 installs.append(self.get_package_id(self.apt_cache, pkg))
12551268
1256 self.cancellable = Gio.Cancellable()1269 self.cancellable = Gio.Cancellable()
1257 try:1270 try:
@@ -1269,6 +1282,11 @@ class SoftwarePropertiesGtk(SoftwareProperties, SimpleGtkbuilderApp):
1269 installs_pending # callback data1282 installs_pending # callback data
1270 )1283 )
1271 if installs:1284 if installs:
1285 if has_nvidia:
1286 to_install = []
1287 for item in installs:
1288 name = item.split(';')[0]
1289 to_install.append(name)
1272 self.pk_task.install_packages_async(installs,1290 self.pk_task.install_packages_async(installs,
1273 self.cancellable, # cancellable1291 self.cancellable, # cancellable
1274 self.on_driver_changes_progress,1292 self.on_driver_changes_progress,
@@ -1376,7 +1394,6 @@ class SoftwarePropertiesGtk(SoftwareProperties, SimpleGtkbuilderApp):
1376 # WARNING: This is run in a separate thread.1394 # WARNING: This is run in a separate thread.
1377 self.detect_called = True1395 self.detect_called = True
1378 try:1396 try:
1379 self.apt_cache = apt.Cache()
1380 self.devices = detect.system_device_drivers(self.apt_cache)1397 self.devices = detect.system_device_drivers(self.apt_cache)
1381 except:1398 except:
1382 # Catch all exceptions and feed them to apport.1399 # Catch all exceptions and feed them to apport.
@@ -1395,22 +1412,16 @@ class SoftwarePropertiesGtk(SoftwareProperties, SimpleGtkbuilderApp):
1395 return1412 return
13961413
1397 pkg = None1414 pkg = None
1398 try:1415 if pkg_name:
1399 if pkg_name:1416 pkg = self.apt_cache[pkg_name]
1400 pkg = self.apt_cache[pkg_name]1417 # Add the matching linux modules package when available
1401 # If the package depends on dkms1418 try:
1402 # we need to install the correct linux metapackage1419 modules_package = detect.get_linux_modules_metapackage(self.apt_cache, pkg_name)
1403 # so that users get the latest headers1420 modules_package_obj = self.apt_cache[modules_package]
1404 if 'dkms' in pkg.candidate.record['Depends']:1421 if modules_package and not modules_package_obj.current_ver:
1405 linux_meta = detect.get_linux(self.apt_cache)1422 self.driver_changes.append(modules_package_obj)
1406 if (linux_meta and1423 except KeyError:
1407 linux_meta not in self.driver_changes):1424 pass
1408 # Install the linux metapackage
1409 lmp = self.apt_cache[linux_meta]
1410 if not lmp.is_installed:
1411 self.driver_changes.append(lmp)
1412 except (AttributeError, KeyError):
1413 pass
14141425
1415 if button.get_active():1426 if button.get_active():
1416 if pkg in self.driver_changes:1427 if pkg in self.driver_changes:
@@ -1430,7 +1441,7 @@ class SoftwarePropertiesGtk(SoftwareProperties, SimpleGtkbuilderApp):
14301441
1431 if (pkg is not None1442 if (pkg is not None
1432 and pkg not in self.driver_changes1443 and pkg not in self.driver_changes
1433 and pkg.is_installed):1444 and pkg.current_ver):
1434 self.driver_changes.append(pkg)1445 self.driver_changes.append(pkg)
14351446
1436 self.button_driver_revert.set_sensitive(bool(self.driver_changes))1447 self.button_driver_revert.set_sensitive(bool(self.driver_changes))
@@ -1492,11 +1503,14 @@ class SoftwarePropertiesGtk(SoftwareProperties, SimpleGtkbuilderApp):
14921503
1493 try:1504 try:
1494 pkg = self.apt_cache[pkg_driver_name]1505 pkg = self.apt_cache[pkg_driver_name]
1495 installed = pkg.is_installed1506 installed = pkg.current_ver
1496 if pkg.candidate is not None:1507 candidate = self.depcache.get_candidate_ver(pkg)
1497 description = _("Using {} from {}").format(pkg.candidate.summary, pkg.shortname)1508
1509 if candidate is not None:
1510 self.records.lookup(candidate.file_list[0])
1511 description = _("Using {} from {}").format(self.records.short_desc, pkg_driver_name)
1498 else:1512 else:
1499 description = _("Using {}").format(pkg.shortname)1513 description = _("Using {}").format(pkg_driver_name)
1500 except KeyError:1514 except KeyError:
1501 print("WARNING: a driver ({}) doesn't have any available package associated: {}".format(pkg_driver_name, current_driver))1515 print("WARNING: a driver ({}) doesn't have any available package associated: {}".format(pkg_driver_name, current_driver))
1502 continue1516 continue
@@ -1626,7 +1640,7 @@ class SoftwarePropertiesGtk(SoftwareProperties, SimpleGtkbuilderApp):
1626 for device in self.devices:1640 for device in self.devices:
1627 for pkg_name in self.devices[device]['drivers']:1641 for pkg_name in self.devices[device]['drivers']:
1628 pkg = self.apt_cache[pkg_name]1642 pkg = self.apt_cache[pkg_name]
1629 if not self.devices[device]['drivers'][pkg_name]['free'] and pkg.is_installed:1643 if not self.devices[device]['drivers'][pkg_name]['free'] and pkg.current_ver:
1630 self.nonfree_drivers = self.nonfree_drivers + 11644 self.nonfree_drivers = self.nonfree_drivers + 1
16311645
1632 if self.nonfree_drivers > 0:1646 if self.nonfree_drivers > 0:
diff --git a/softwareproperties/qt/SoftwarePropertiesQt.py b/softwareproperties/qt/SoftwarePropertiesQt.py
index 332bf06..e9e5818 100644
--- a/softwareproperties/qt/SoftwarePropertiesQt.py
+++ b/softwareproperties/qt/SoftwarePropertiesQt.py
@@ -55,7 +55,6 @@ from .CdromProgress import CdromProgress
5555
56from UbuntuDrivers import detect56from UbuntuDrivers import detect
57import sys57import sys
58import apt
59from functools import partial58from functools import partial
60import aptsources.distro59import aptsources.distro
61import logging60import logging
@@ -345,6 +344,18 @@ class SoftwarePropertiesQt(SoftwareProperties):
345 self.userinterface.combobox_server.addItem(_("Other..."))344 self.userinterface.combobox_server.addItem(_("Other..."))
346 self.other_mirrors_index = self.userinterface.combobox_server.count() - 1345 self.other_mirrors_index = self.userinterface.combobox_server.count() - 1
347346
347 def init_apt_cache(self):
348 apt_pkg.init_config()
349 apt_pkg.init_system()
350 self.apt_cache = apt_pkg.Cache(None)
351 self.depcache = apt_pkg.DepCache(self.apt_cache)
352 self.records = apt_pkg.PackageRecords(self.apt_cache)
353
354 def update_apt_cache(self):
355 self.apt_cache = apt_pkg.Cache(None)
356 self.depcache = apt_pkg.DepCache(self.apt_cache)
357 self.records = apt_pkg.PackageRecords(self.apt_cache)
358
348 def show_distro(self):359 def show_distro(self):
349 """360 """
350 Represent the distro information in the user interface361 Represent the distro information in the user interface
@@ -736,7 +747,7 @@ class SoftwarePropertiesQt(SoftwareProperties):
736747
737 def on_restore_clicked(self):748 def on_restore_clicked(self):
738 """Restore the original keys"""749 """Restore the original keys"""
739 self.apt_key.update()750 self.update_apt_cache()
740 self.show_keys()751 self.show_keys()
741752
742 def on_pktask_progress(self, progress, ptype, udata=(None,)):753 def on_pktask_progress(self, progress, ptype, udata=(None,)):
@@ -859,7 +870,7 @@ class SoftwarePropertiesQt(SoftwareProperties):
859 if not installs_pending:870 if not installs_pending:
860 self.progress_bar.setVisible(False)871 self.progress_bar.setVisible(False)
861 self.clear_changes()872 self.clear_changes()
862 self.apt_cache = apt.Cache()873 self.update_apt_cache()
863 self.set_driver_action_status()874 self.set_driver_action_status()
864 self.update_label_and_icons_from_status()875 self.update_label_and_icons_from_status()
865 self.button_driver_revert.setVisible(True)876 self.button_driver_revert.setVisible(True)
@@ -885,19 +896,20 @@ class SoftwarePropertiesQt(SoftwareProperties):
885 installs = []896 installs = []
886 removals = []897 removals = []
887898
899 has_nvidia = False
888 for pkg in self.driver_changes:900 for pkg in self.driver_changes:
889 if pkg.is_installed:901 if pkg.current_ver:
890 removals.append(self.get_package_id(pkg.installed))902 removals.append(self.get_package_id(self.apt_cache, pkg))
891 # The main NVIDIA package is only a metapackage.903 # The main NVIDIA package is only a metapackage.
892 # We need to collect its dependencies, so that904 # We need to collect its dependencies, so that
893 # we can uninstall the driver properly.905 # we can uninstall the driver properly.
894 if 'nvidia' in pkg.shortname:906 if 'nvidia' in pkg.name:
895 for dep in self.get_dependencies(self.apt_cache, pkg.shortname, 'nvidia'):907 has_nvidia = True
896 dep_pkg = self.apt_cache[dep]908 for dep in self.get_dependencies(self.apt_cache, pkg, 'nvidia'):
897 if dep_pkg.is_installed:909 if dep.current_ver:
898 removals.append(self.get_package_id(dep_pkg.installed))910 removals.append(self.get_package_id(self.apt_cache, dep))
899 else:911 else:
900 installs.append(self.get_package_id(pkg.candidate))912 installs.append(self.get_package_id(self.apt_cache, pkg))
901913
902 self.cancellable = Gio.Cancellable()914 self.cancellable = Gio.Cancellable()
903 try:915 try:
@@ -915,6 +927,11 @@ class SoftwarePropertiesQt(SoftwareProperties):
915 installs_pending # callback data927 installs_pending # callback data
916 )928 )
917 if installs:929 if installs:
930 if has_nvidia:
931 to_install = []
932 for item in installs:
933 name = item.split(';')[0]
934 to_install.append(name)
918 self.pk_task.install_packages_async(installs,935 self.pk_task.install_packages_async(installs,
919 self.cancellable, # cancellable936 self.cancellable, # cancellable
920 self.on_driver_changes_progress,937 self.on_driver_changes_progress,
@@ -1019,8 +1036,8 @@ class SoftwarePropertiesQt(SoftwareProperties):
1019 def detect_drivers(self):1036 def detect_drivers(self):
1020 # WARNING: This is run in a separate thread.1037 # WARNING: This is run in a separate thread.
1021 self.detect_called = True1038 self.detect_called = True
1039 self.init_apt_cache()
1022 try:1040 try:
1023 self.apt_cache = apt.Cache()
1024 self.devices = detect.system_device_drivers(self.apt_cache)1041 self.devices = detect.system_device_drivers(self.apt_cache)
1025 except:1042 except:
1026 # Catch all exceptions and feed them to apport.1043 # Catch all exceptions and feed them to apport.
@@ -1039,21 +1056,17 @@ class SoftwarePropertiesQt(SoftwareProperties):
1039 return1056 return
10401057
1041 pkg = None1058 pkg = None
1042 try:1059
1043 if pkg_name:1060 if pkg_name:
1044 pkg = self.apt_cache[pkg_name]1061 pkg = self.apt_cache[pkg_name]
1045 # If the package depends on dkms1062 # Add the matching linux modules package when available
1046 # we need to install the correct linux metapackage1063 try:
1047 # so that users get the latest headers1064 modules_package = detect.get_linux_modules_metapackage(self.apt_cache, pkg_name)
1048 if 'dkms' in pkg.candidate.record['Depends']:1065 modules_package_obj = self.apt_cache[modules_package]
1049 linux_meta = detect.get_linux(self.apt_cache)1066 if modules_package and not modules_package_obj.current_ver:
1050 if (linux_meta and linux_meta not in self.driver_changes):1067 self.driver_changes.append(modules_package_obj)
1051 # Install the linux metapackage1068 except KeyError:
1052 lmp = self.apt_cache[linux_meta]1069 pass
1053 if not lmp.is_installed:
1054 self.driver_changes.append(lmp)
1055 except KeyError:
1056 pass
10571070
1058 if button.isChecked():1071 if button.isChecked():
1059 if pkg in self.driver_changes:1072 if pkg in self.driver_changes:
@@ -1069,7 +1082,7 @@ class SoftwarePropertiesQt(SoftwareProperties):
1069 if modalias not in self.orig_selection:1082 if modalias not in self.orig_selection:
1070 self.orig_selection[modalias] = button1083 self.orig_selection[modalias] = button
10711084
1072 if (pkg is not None and pkg not in self.driver_changes and pkg.is_installed):1085 if (pkg is not None and pkg not in self.driver_changes and pkg.current_ver):
1073 self.driver_changes.append(pkg)1086 self.driver_changes.append(pkg)
10741087
1075 self.button_driver_revert.setEnabled(bool(self.driver_changes))1088 self.button_driver_revert.setEnabled(bool(self.driver_changes))
@@ -1137,11 +1150,13 @@ None if not applicable
11371150
1138 try:1151 try:
1139 pkg = self.apt_cache[pkg_driver_name]1152 pkg = self.apt_cache[pkg_driver_name]
1140 installed = pkg.is_installed1153 installed = pkg.current_ver or False
1141 if pkg.candidate is not None:1154 candidate = self.depcache.get_candidate_ver(pkg)
1142 description = _("Using {} from {}").format(pkg.candidate.summary, pkg.shortname)1155 if candidate is not None:
1156 self.records.lookup(candidate.file_list[0])
1157 description = _("Using {} from {}").format(self.records.short_desc, pkg_driver_name)
1143 else:1158 else:
1144 description = _("Using {}").format(pkg.shortname)1159 description = _("Using {}").format(pkg_driver_name)
1145 except KeyError:1160 except KeyError:
1146 print("WARNING: a driver ({}) doesn't have any available package associated: {}".format(pkg_driver_name, current_driver))1161 print("WARNING: a driver ({}) doesn't have any available package associated: {}".format(pkg_driver_name, current_driver))
1147 continue1162 continue
@@ -1277,7 +1292,7 @@ licence=licence)
1277 for device in self.devices:1292 for device in self.devices:
1278 for pkg_name in self.devices[device]['drivers']:1293 for pkg_name in self.devices[device]['drivers']:
1279 pkg = self.apt_cache[pkg_name]1294 pkg = self.apt_cache[pkg_name]
1280 if not self.devices[device]['drivers'][pkg_name]['free'] and pkg.is_installed:1295 if not self.devices[device]['drivers'][pkg_name]['free'] and pkg.current_ver:
1281 self.nonfree_drivers = self.nonfree_drivers + 11296 self.nonfree_drivers = self.nonfree_drivers + 1
12821297
1283 if self.nonfree_drivers > 0:1298 if self.nonfree_drivers > 0:

Subscribers

People subscribed via source and target branches