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
diff --git a/ubiquity/frontend/gtk_ui.py b/ubiquity/frontend/gtk_ui.py
index e63046c..ab76c86 100644
--- a/ubiquity/frontend/gtk_ui.py
+++ b/ubiquity/frontend/gtk_ui.py
@@ -587,6 +587,29 @@ class Wizard(BaseFrontend):
587587
588 gsettings.set(gs_schema, gs_key, gs_value)588 gsettings.set(gs_schema, gs_key, gs_value)
589589
590 def disable_screen_blanking(self):
591 gs_schema = 'org.gnome.desktop.session'
592 gs_key = 'idle-delay'
593 gs_previous = '%s/%s' % (gs_schema, gs_key)
594 if gs_previous in self.gsettings_previous:
595 return
596
597 gs_value = gsettings.get(gs_schema, gs_key)
598 self.gsettings_previous[gs_previous] = gs_value
599
600 if gs_value:
601 gsettings.set(gs_schema, gs_key, 0)
602
603 atexit.register(self.enable_screen_blanking)
604
605 def enable_screen_blanking(self):
606 gs_schema = 'org.gnome.desktop.session'
607 gs_key = 'idle-delay'
608 gs_previous = '%s/%s' % (gs_schema, gs_key)
609 gs_value = self.gsettings_previous[gs_previous]
610
611 gsettings.set(gs_schema, gs_key, gs_value)
612
590 def disable_powermgr(self):613 def disable_powermgr(self):
591 gs_schema = 'org.gnome.settings-daemon.plugins.power'614 gs_schema = 'org.gnome.settings-daemon.plugins.power'
592 gs_key = 'active'615 gs_key = 'active'
@@ -738,6 +761,7 @@ class Wizard(BaseFrontend):
738761
739 self.disable_volume_manager()762 self.disable_volume_manager()
740 self.disable_screensaver()763 self.disable_screensaver()
764 self.disable_screen_blanking()
741 self.disable_powermgr()765 self.disable_powermgr()
742766
743 if 'UBIQUITY_ONLY' in os.environ:767 if 'UBIQUITY_ONLY' in os.environ:
@@ -1699,12 +1723,14 @@ class Wizard(BaseFrontend):
1699 dbfilter.start(auto_process=True)1723 dbfilter.start(auto_process=True)
17001724
1701 elif finished_step == 'ubi-timezone':1725 elif finished_step == 'ubi-timezone':
1702 self.timezone_set = True1726 # Only do this once; restarting debconf under the installer is bad.
1703 # Flush changes to the database so that when the parallel db1727 if not self.timezone_set:
1704 # starts, it does so with the most recent changes.1728 # Flush changes to the database so that when the parallel db
1705 self.stop_debconf()1729 # starts, it does so with the most recent changes.
1706 self.start_debconf()1730 self.stop_debconf()
1707 self.maybe_start_installing()1731 self.start_debconf()
1732 self.timezone_set = True
1733 self.maybe_start_installing()
17081734
1709 elif finished_step == 'ubiquity.components.partman_commit':1735 elif finished_step == 'ubiquity.components.partman_commit':
1710 self.partitioned = True1736 self.partitioned = True
diff --git a/ubiquity/frontend/kde_ui.py b/ubiquity/frontend/kde_ui.py
index 9a285a5..1f537b5 100644
--- a/ubiquity/frontend/kde_ui.py
+++ b/ubiquity/frontend/kde_ui.py
@@ -1345,12 +1345,14 @@ class Wizard(BaseFrontend):
1345 dbfilter.start(auto_process=True)1345 dbfilter.start(auto_process=True)
13461346
1347 elif finished_step == 'ubi-timezone':1347 elif finished_step == 'ubi-timezone':
1348 self.timezone_set = True1348 # Only do this once; restarting debconf under the installer is bad.
1349 # Flush changes to the database so that when the parallel db1349 if not self.timezone_set:
1350 # starts, it does so with the most recent changes.1350 # Flush changes to the database so that when the parallel db
1351 self.stop_debconf()1351 # starts, it does so with the most recent changes.
1352 self.start_debconf()1352 self.stop_debconf()
1353 self.maybe_start_installing()1353 self.start_debconf()
1354 self.timezone_set = True
1355 self.maybe_start_installing()
13541356
1355 elif finished_step == 'ubiquity.components.partman_commit':1357 elif finished_step == 'ubiquity.components.partman_commit':
1356 self.partitioned = True1358 self.partitioned = True
diff --git a/ubiquity/gsettings.py b/ubiquity/gsettings.py
index 7f06f6e..7b1cced 100644
--- a/ubiquity/gsettings.py
+++ b/ubiquity/gsettings.py
@@ -68,6 +68,8 @@ def get(schema, key, user=None):
68 # Parse ints68 # Parse ints
69 if value.isdigit():69 if value.isdigit():
70 return int(value)70 return int(value)
71 if value.startswith('uint32'): # uint32 100
72 return int(value.split()[1])
7173
72 # Parse booleans74 # Parse booleans
73 if value == 'false':75 if value == 'false':

Subscribers

People subscribed via source and target branches