Skip to content

Commit 81d352e

Browse files
committed
Report UI progress in PostUpdate scenario when installing 3rd party apps
This should help with the progress monitor getting a signal during this long duration phase.
1 parent 034115a commit 81d352e

File tree

2 files changed

+31
-3
lines changed

2 files changed

+31
-3
lines changed

debian/changelog

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,12 @@ kano-updater (4.2.1-0) unstable; urgency=low
1111
* Added free disk space check before download phase
1212
* Restore DHCP hotfix for users experiencing Wireless reconnection issues on boot
1313
* Migrate to using mirrored version of Raspbian repo
14+
* Prioritised update from v3.7 to v3.8 over installation of 3rd party
15+
apps in PostUpdate scenario
16+
* Report UI progress in v3.7 to v3.8 PostUpdate scenario when installing
17+
3rd party apps
1418

15-
-- Team Kano <dev@kano.me> Mon, 21 Jan 2019 14:12:00 +0000
19+
-- Team Kano <dev@kano.me> Wed, 13 Feb 2019 14:12:00 +0000
1620

1721
kano-updater (4.2.0-0) unstable; urgency=low
1822

@@ -69,8 +73,10 @@ kano-updater (3.16.2-0) unstable; urgency=low
6973
* Backport: Configure dpkg to run in noninteractive mode to avoid potential update freezes
7074
* Backport: Prioritised update from v3.7 to v3.8 over installation of 3rd
7175
party apps in PostUpdate scenario
76+
* Backport: Report UI progress in v3.7 to v3.8 PostUpdate scenario when
77+
installing 3rd party apps
7278

73-
-- Team Kano <dev@kano.me> Tue, 12 Feb 2019 15:12:00 +0000
79+
-- Team Kano <dev@kano.me> Wed, 13 Feb 2019 15:12:00 +0000
7480

7581
kano-updater (3.16.1-0) unstable; urgency=low
7682

kano_updater/scenarios.py

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
from kano_init.utils import reconfigure_autostart_policy
2121

22+
from kano_updater.progress import Phase
2223
from kano_updater.os_version import OSVersion, get_target_version
2324
from kano_updater.utils import install, remove_user_files, update_failed, \
2425
purge, rclocal_executable, migrate_repository, get_users, run_for_every_user
@@ -902,7 +903,7 @@ def _bootconfig_set_value_helper(self, setting, value):
902903
except ImportError:
903904
logger.error("end_config_transaciton not present - update to kano-settings failed?")
904905

905-
def beta_370_to_beta_380(self, dummy_progress):
906+
def beta_370_to_beta_380(self, progress):
906907
# linux kernel 4.4.21 shipped with Kano 3.8.0 emits systemd boot messages.
907908
# fix by telling the kernel to enable an empty splash screen.
908909
command = "sed -i 's/\\bsystemd.show_status=0\\b/splash/' {}".format('/boot/cmdline.txt')
@@ -934,6 +935,25 @@ def beta_370_to_beta_380(self, dummy_progress):
934935
{'kw_app': 'tux-typing', 'disk_req': 26},
935936
{'kw_app': 'libreoffice', 'disk_req': 385},
936937
]
938+
phases = [
939+
Phase(
940+
app['kw_app'],
941+
_("Installing {} from the App Store")
942+
.format(app['kw_app']),
943+
app['disk_req']
944+
)
945+
for app in new_apps
946+
]
947+
# TODO: Because the Pre/PostUpdate scenarios don't split the
948+
# progress, this last phase essentially is used to preserve the
949+
# phase from install.
950+
phases.append(
951+
Phase(
952+
'continue-postupdate',
953+
_("Running The Postupdate Scripts")
954+
)
955+
)
956+
progress.split(*phases)
937957

938958
run_cmd_log('apt-get autoremove -y')
939959

@@ -944,6 +964,7 @@ def beta_370_to_beta_380(self, dummy_progress):
944964
mb_required = app['disk_req'] + 250 # MB buffer
945965

946966
if mb_free > mb_required:
967+
progress.start(app['kw_app'])
947968
run_cmd_log('kano-apps install --no-gui {app}'.format(app=app['kw_app']))
948969
else:
949970
logger.warn(
@@ -964,6 +985,7 @@ def beta_370_to_beta_380(self, dummy_progress):
964985
)
965986
finally:
966987
run_cmd_log('apt-get clean')
988+
progress.start('continue-postupdate')
967989

968990
# Tell kano-init to put the automatic logins up-to-date
969991
reconfigure_autostart_policy()

0 commit comments

Comments
 (0)