Merge ubiquity:only-start-installing-once into ubiquity:master

Proposed by Iain Lane
Status: Rejected
Rejected by: Iain Lane
Proposed branch: ubiquity:only-start-installing-once
Merge into: ubiquity:master
Diff against target: 101 lines (+42/-12)
3 files modified
ubiquity/frontend/gtk_ui.py (+32/-6)
ubiquity/frontend/kde_ui.py (+8/-6)
ubiquity/gsettings.py (+2/-0)
Reviewer Review Type Date Requested Status
Ubuntu Installer Team Pending
Review via email: mp+357619@code.launchpad.net

Description of the change

Don't start installing a second time after going timezone -> user setup -> timezone -> user setup again.

This might partially reopen https://bugs.launchpad.net/ubuntu/+source/ubiquity/+bug/1797579 in that the location selected the second time might suffer from that bug.

Only merge one of this and:

  https://code.launchpad.net/~ubuntu-installer/ubiquity/+git/ubiquity/+merge/357618

To post a comment you must log in.

Unmerged commits

99b7e3a... by Iain Lane

gtk,kde: Don't start installing multiple times

If we go back and forth between timezone and usersetup multiple times,
we can end up restarting debconf under an in-progress installation
process or starting the installation multiple times. This is obviously
bad, and can end up with the installer crashing.

Only restart debconf and start the installation the *first* time the
user clicks next from the timezone step.

https://bugs.launchpad.net/ubuntu/+source/ubiquity/+bug/1799097

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/ubiquity/frontend/gtk_ui.py b/ubiquity/frontend/gtk_ui.py
2index e63046c..ab76c86 100644
3--- a/ubiquity/frontend/gtk_ui.py
4+++ b/ubiquity/frontend/gtk_ui.py
5@@ -587,6 +587,29 @@ class Wizard(BaseFrontend):
6
7 gsettings.set(gs_schema, gs_key, gs_value)
8
9+ def disable_screen_blanking(self):
10+ gs_schema = 'org.gnome.desktop.session'
11+ gs_key = 'idle-delay'
12+ gs_previous = '%s/%s' % (gs_schema, gs_key)
13+ if gs_previous in self.gsettings_previous:
14+ return
15+
16+ gs_value = gsettings.get(gs_schema, gs_key)
17+ self.gsettings_previous[gs_previous] = gs_value
18+
19+ if gs_value:
20+ gsettings.set(gs_schema, gs_key, 0)
21+
22+ atexit.register(self.enable_screen_blanking)
23+
24+ def enable_screen_blanking(self):
25+ gs_schema = 'org.gnome.desktop.session'
26+ gs_key = 'idle-delay'
27+ gs_previous = '%s/%s' % (gs_schema, gs_key)
28+ gs_value = self.gsettings_previous[gs_previous]
29+
30+ gsettings.set(gs_schema, gs_key, gs_value)
31+
32 def disable_powermgr(self):
33 gs_schema = 'org.gnome.settings-daemon.plugins.power'
34 gs_key = 'active'
35@@ -738,6 +761,7 @@ class Wizard(BaseFrontend):
36
37 self.disable_volume_manager()
38 self.disable_screensaver()
39+ self.disable_screen_blanking()
40 self.disable_powermgr()
41
42 if 'UBIQUITY_ONLY' in os.environ:
43@@ -1699,12 +1723,14 @@ class Wizard(BaseFrontend):
44 dbfilter.start(auto_process=True)
45
46 elif finished_step == 'ubi-timezone':
47- self.timezone_set = True
48- # Flush changes to the database so that when the parallel db
49- # starts, it does so with the most recent changes.
50- self.stop_debconf()
51- self.start_debconf()
52- self.maybe_start_installing()
53+ # Only do this once; restarting debconf under the installer is bad.
54+ if not self.timezone_set:
55+ # Flush changes to the database so that when the parallel db
56+ # starts, it does so with the most recent changes.
57+ self.stop_debconf()
58+ self.start_debconf()
59+ self.timezone_set = True
60+ self.maybe_start_installing()
61
62 elif finished_step == 'ubiquity.components.partman_commit':
63 self.partitioned = True
64diff --git a/ubiquity/frontend/kde_ui.py b/ubiquity/frontend/kde_ui.py
65index 9a285a5..1f537b5 100644
66--- a/ubiquity/frontend/kde_ui.py
67+++ b/ubiquity/frontend/kde_ui.py
68@@ -1345,12 +1345,14 @@ class Wizard(BaseFrontend):
69 dbfilter.start(auto_process=True)
70
71 elif finished_step == 'ubi-timezone':
72- self.timezone_set = True
73- # Flush changes to the database so that when the parallel db
74- # starts, it does so with the most recent changes.
75- self.stop_debconf()
76- self.start_debconf()
77- self.maybe_start_installing()
78+ # Only do this once; restarting debconf under the installer is bad.
79+ if not self.timezone_set:
80+ # Flush changes to the database so that when the parallel db
81+ # starts, it does so with the most recent changes.
82+ self.stop_debconf()
83+ self.start_debconf()
84+ self.timezone_set = True
85+ self.maybe_start_installing()
86
87 elif finished_step == 'ubiquity.components.partman_commit':
88 self.partitioned = True
89diff --git a/ubiquity/gsettings.py b/ubiquity/gsettings.py
90index 7f06f6e..7b1cced 100644
91--- a/ubiquity/gsettings.py
92+++ b/ubiquity/gsettings.py
93@@ -68,6 +68,8 @@ def get(schema, key, user=None):
94 # Parse ints
95 if value.isdigit():
96 return int(value)
97+ if value.startswith('uint32'): # uint32 100
98+ return int(value.split()[1])
99
100 # Parse booleans
101 if value == 'false':

Subscribers

People subscribed via source and target branches