update-manager: update remove livepatch patch.
This commit is contained in:
parent
0293b82543
commit
31e98ea7e6
2 changed files with 19 additions and 11 deletions
74
helpers/DATA/update-manager/remove-livepatch2.patch
Normal file
74
helpers/DATA/update-manager/remove-livepatch2.patch
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
diff -ru a/UpdateManager/Dialogs.py b/UpdateManager/Dialogs.py
|
||||
--- a/UpdateManager/Dialogs.py 2022-04-11 07:56:45.000000000 +0000
|
||||
+++ b/UpdateManager/Dialogs.py.clean 2022-06-21 18:44:39.204551351 +0000
|
||||
@@ -148,70 +148,6 @@
|
||||
self.main_container.add(content_widget)
|
||||
self.main_container.set_visible(bool(content_widget))
|
||||
|
||||
- def _is_livepatch_supported(self):
|
||||
- di = distro_info.UbuntuDistroInfo()
|
||||
- codename = get_dist()
|
||||
- return di.is_lts(codename)
|
||||
-
|
||||
- def _has_livepatch_settings_ui(self):
|
||||
- try:
|
||||
- return Gio.DesktopAppInfo \
|
||||
- .new('gnome-online-accounts-panel.desktop')
|
||||
- except Exception:
|
||||
- return None
|
||||
-
|
||||
- def on_livepatch_status_ready(self, active, cs, ps, fixes):
|
||||
- self.set_desc(None)
|
||||
-
|
||||
- if not active:
|
||||
- if self._is_livepatch_supported() and \
|
||||
- self.settings_button and \
|
||||
- self._has_livepatch_settings_ui() and \
|
||||
- self.settings.get_int('launch-count') >= 4:
|
||||
- self.set_desc(_("<b>Tip:</b> You can use Livepatch to "
|
||||
- "keep your computer more secure between "
|
||||
- "restarts."))
|
||||
- self.settings_button.set_label(_("Settings & Livepatch…"))
|
||||
- return
|
||||
-
|
||||
- needs_reschedule = False
|
||||
-
|
||||
- if cs == "needs-check":
|
||||
- needs_reschedule = True
|
||||
- elif cs == "check-failed":
|
||||
- pass
|
||||
- elif cs == "checked":
|
||||
- if ps == "unapplied" or ps == "applying":
|
||||
- needs_reschedule = True
|
||||
- elif ps == "applied":
|
||||
- fixes = [fix for fix in fixes if fix.patched]
|
||||
- d = ngettext("%d Livepatch update applied since the last "
|
||||
- "restart.",
|
||||
- "%d Livepatch updates applied since the last "
|
||||
- "restart.",
|
||||
- len(fixes)) % len(fixes)
|
||||
- self.set_desc(d)
|
||||
- elif ps == "applied-with-bug" or ps == "apply-failed":
|
||||
- fixes = [fix for fix in fixes if fix.patched]
|
||||
- d = ngettext("%d Livepatch update failed to apply since the "
|
||||
- "last restart.",
|
||||
- "%d Livepatch updates failed to apply since the "
|
||||
- "last restart.",
|
||||
- len(fixes)) % len(fixes)
|
||||
- self.set_desc(d)
|
||||
- elif ps == "nothing-to-apply":
|
||||
- pass
|
||||
- elif ps == "unknown":
|
||||
- pass
|
||||
-
|
||||
- if needs_reschedule:
|
||||
- self.lp_socket.get_status(self.on_livepatch_status_ready)
|
||||
-
|
||||
- def check_livepatch_status(self):
|
||||
- self.lp_socket = LivePatchSocket()
|
||||
- self.lp_socket.get_status(self.on_livepatch_status_ready)
|
||||
-
|
||||
-
|
||||
class StoppedUpdatesDialog(InternalDialog):
|
||||
def __init__(self, window_main):
|
||||
InternalDialog.__init__(self, window_main)
|
||||
Loading…
Add table
Add a link
Reference in a new issue