Merge branch 'fix-update-utilites' into 'etiona'

Fix update utilites

See merge request trisquel/package-helpers!252
This commit is contained in:
Ruben Rodriguez 2019-09-13 21:40:42 +00:00
commit 9e226bcae7
4 changed files with 90 additions and 11 deletions

View file

@ -25,14 +25,14 @@ diff -ru source.orig/UpdateManager/Dialogs.py source/UpdateManager/Dialogs.py
diff -ru source.orig/UpdateManager/UpdateManager.py source/UpdateManager/UpdateManager.py
--- source.orig/UpdateManager/UpdateManager.py 2018-02-12 20:44:33.317329071 -0500
+++ source/UpdateManager/UpdateManager.py 2018-02-12 20:45:28.133249491 -0500
@@ -50,6 +50,7 @@
@@ -52,6 +52,7 @@
ErrorDialog,
HWEUpgradeDialog,
NeedRestartDialog,
NoUpdatesDialog,
+ ShouldUpdateDialog,
StoppedUpdatesDialog,
NoUpdatesDialog,
PartialUpgradeDialog,
UnsupportedDialog,
StoppedUpdatesDialog,
@@ -205,6 +206,17 @@
self.start_available()

View file

@ -0,0 +1,66 @@
diff --git a/UpdateManager/Dialogs.py b/UpdateManager/Dialogs.py
index b100c3a..d604f54 100644
--- a/UpdateManager/Dialogs.py
+++ b/UpdateManager/Dialogs.py
@@ -149,61 +149,6 @@ class InternalDialog(BuilderDialog):
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 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.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):