|
21 | 21 | import traceback |
22 | 22 | import setproctitle |
23 | 23 | import platform |
| 24 | +import re |
24 | 25 |
|
25 | 26 | from kernelwindow import KernelWindow |
26 | 27 | gi.require_version('Gtk', '3.0') |
@@ -461,11 +462,18 @@ def run(self): |
461 | 462 | for pkg in update.package_names: |
462 | 463 | if "-image-" in pkg: |
463 | 464 | try: |
464 | | - kernel_version = platform.release().split("-")[0] |
| 465 | + if self.application.is_lmde: |
| 466 | + # In Mint, platform.release() returns the kernel version. In LMDE it returns the kernel |
| 467 | + # abi version. So for LMDE, parse platform.version() instead. |
| 468 | + version_string = platform.version() |
| 469 | + kernel_version = re.search(r"(\d+\.\d+\.\d+)", version_string).group(1) |
| 470 | + else: |
| 471 | + kernel_version = platform.release().split("-")[0] |
| 472 | + |
465 | 473 | if update.old_version.startswith(kernel_version): |
466 | 474 | self.reboot_required = True |
467 | | - except: |
468 | | - print("Warning: Could not assess the current kernel version.") |
| 475 | + except Exception as e: |
| 476 | + print("Warning: Could not assess the current kernel version: %s" % str(e)) |
469 | 477 | self.reboot_required = True |
470 | 478 | break |
471 | 479 | if update.type == "security" and \ |
@@ -1375,6 +1383,7 @@ def __init__(self): |
1375 | 1383 | self.logger.write("Launching Update Manager") |
1376 | 1384 | self.settings = Gio.Settings(schema_id="com.linuxmint.updates") |
1377 | 1385 |
|
| 1386 | + self.is_lmde = False |
1378 | 1387 | self.app_restart_required = False |
1379 | 1388 | self.show_cinnamon_enabled = False |
1380 | 1389 | self.settings.connect("changed", self._on_settings_changed) |
@@ -1667,6 +1676,8 @@ def __init__(self): |
1667 | 1676 | # Only support kernel selection in Linux Mint (not LMDE) |
1668 | 1677 | if not os.path.exists("/usr/share/doc/debian-system-adjustments/copyright"): |
1669 | 1678 | viewSubmenu.append(kernelMenuItem) |
| 1679 | + else: |
| 1680 | + self.is_lmde = True |
1670 | 1681 | except Exception as e: |
1671 | 1682 | print (e) |
1672 | 1683 | print(sys.exc_info()[0]) |
|
0 commit comments