Merge lp:~azzar1/update-manager/lp-1787553-bionic into lp:~ubuntu-core-dev/update-manager/bionic

Proposed by Andrea Azzarone
Status: Merged
Approved by: Sebastien Bacher
Approved revision: 2828
Merged at revision: 2832
Proposed branch: lp:~azzar1/update-manager/lp-1787553-bionic
Merge into: lp:~ubuntu-core-dev/update-manager/bionic
Diff against target: 119 lines (+31/-1)
5 files modified
UpdateManager/Dialogs.py (+17/-1)
data/com.ubuntu.update-manager.gschema.xml.in (+5/-0)
debian/changelog (+7/-0)
debian/control (+1/-0)
update-manager (+1/-0)
To merge this branch: bzr merge lp:~azzar1/update-manager/lp-1787553-bionic
Reviewer Review Type Date Requested Status
Sebastien Bacher Approve
Review via email: mp+354455@code.launchpad.net

This proposal supersedes a proposal from 2018-09-07.

Commit message

Add a reminder to enable Livepatch (LP: #1787553).

To post a comment you must log in.
Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks, we indeed want that in bionic

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'UpdateManager/Dialogs.py'
2--- UpdateManager/Dialogs.py 2018-02-09 12:48:59 +0000
3+++ UpdateManager/Dialogs.py 2018-09-07 09:01:11 +0000
4@@ -26,6 +26,7 @@
5 gi.require_version("Gtk", "3.0")
6 from gi.repository import Gtk
7 from gi.repository import Gdk
8+from gi.repository import Gio
9 import warnings
10 warnings.filterwarnings(
11 "ignore", "Accessed deprecated property", DeprecationWarning)
12@@ -33,11 +34,13 @@
13 import logging
14 import datetime
15 import dbus
16+import distro_info
17 import os
18 import subprocess
19
20 import HweSupportStatus.consts
21 from .Core.LivePatchSocket import LivePatchSocket
22+from .Core.utils import get_dist
23
24 from gettext import gettext as _
25 from gettext import ngettext
26@@ -97,6 +100,8 @@
27 ui_path = os.path.join(window_main.datadir, "gtkbuilder/Dialog.ui")
28 BuilderDialog.__init__(self, window_main, ui_path, "pane_dialog")
29
30+ self.settings = Gio.Settings.new("com.ubuntu.update-manager")
31+
32 self.focus_button = None
33 self.set_content_widget(content_widget)
34 self.connect("realize", self._on_realize)
35@@ -144,10 +149,21 @@
36 self.main_container.add(content_widget)
37 self.main_container.set_visible(bool(content_widget))
38
39+ def _is_livepatch_supported(self):
40+ di = distro_info.UbuntuDistroInfo()
41+ codename = get_dist()
42+ return di.is_lts(codename)
43+
44 def on_livepatch_status_ready(self, active, cs, ps, fixes):
45 self.set_desc(None)
46
47 if not active:
48+ if self._is_livepatch_supported() and \
49+ self.settings.get_int('launch-count') >= 4:
50+ self.set_desc(_("<b>Tip:</b> You can use Livepatch to "
51+ "keep your computer more secure between "
52+ "restarts."))
53+ self.settings_button.set_label(_("Settings & Livepatch…"))
54 return
55
56 needs_reschedule = False
57@@ -208,7 +224,7 @@
58 self.set_header(_("No software updates are available."))
59 else:
60 self.set_header(_("The software on this computer is up to date."))
61- self.add_settings_button()
62+ self.settings_button = self.add_settings_button()
63 self.focus_button = self.add_button(Gtk.STOCK_OK,
64 self.window_main.close)
65 self.check_livepatch_status()
66
67=== modified file 'data/com.ubuntu.update-manager.gschema.xml.in'
68--- data/com.ubuntu.update-manager.gschema.xml.in 2017-03-14 20:46:06 +0000
69+++ data/com.ubuntu.update-manager.gschema.xml.in 2018-09-07 09:01:11 +0000
70@@ -50,5 +50,10 @@
71 <summary>Time when update-manager got launched last</summary>
72 <description>The last time update-manager was run.</description>
73 </key>
74+ <key name="launch-count" type="i">
75+ <default>0</default>
76+ <summary>Number of times update-manager has been launched</summary>
77+ <description>Number of times update-manager has been launched.</description>
78+ </key>
79 </schema>
80 </schemalist>
81
82=== modified file 'debian/changelog'
83--- debian/changelog 2018-07-20 10:35:52 +0000
84+++ debian/changelog 2018-09-07 09:01:11 +0000
85@@ -1,3 +1,10 @@
86+update-manager (1:18.04.11.5) UNRELEASED; urgency=medium
87+
88+ * Add a reminder to enable Livepatch (LP: #1787553).
89+ * Build-Depends on python3-distro-info.
90+
91+ -- Andrea Azzarone <andrea.azzarone@canonical.com> Fri, 07 Sep 2018 10:41:28 +0200
92+
93 update-manager (1:18.04.11.4) bionic; urgency=medium
94
95 * Adjust dates in hwe-support-status for bionic (LP: #1775236)
96
97=== modified file 'debian/control'
98--- debian/control 2018-04-12 18:06:59 +0000
99+++ debian/control 2018-09-07 09:01:11 +0000
100@@ -7,6 +7,7 @@
101 python3-all (>= 3.3.0-2),
102 python3-distutils-extra (>= 2.38),
103 python3-dbus,
104+ python3-distro-info,
105 python3-gi (>= 3.8),
106 python3-yaml,
107 gir1.2-gtk-3.0,
108
109=== modified file 'update-manager'
110--- update-manager 2017-07-12 22:03:00 +0000
111+++ update-manager 2018-09-07 09:01:11 +0000
112@@ -111,6 +111,7 @@
113 # keep track when we run (for update-notifier)
114 settings = Gio.Settings.new("com.ubuntu.update-manager")
115 settings.set_int64("launch-time", int(time.time()))
116+ settings.set_int("launch-count", settings.get_int("launch-count") + 1)
117 init_proxy(settings)
118
119 app = UpdateManager(data_dir, options)

Subscribers

People subscribed via source and target branches