19
19
20
20
from kano_init .utils import reconfigure_autostart_policy
21
21
22
+ from kano_updater .progress import Phase
22
23
from kano_updater .os_version import OSVersion , get_target_version
23
24
from kano_updater .utils import install , remove_user_files , update_failed , \
24
25
purge , rclocal_executable , migrate_repository , get_users , run_for_every_user
@@ -902,7 +903,7 @@ def _bootconfig_set_value_helper(self, setting, value):
902
903
except ImportError :
903
904
logger .error ("end_config_transaciton not present - update to kano-settings failed?" )
904
905
905
- def beta_370_to_beta_380 (self , dummy_progress ):
906
+ def beta_370_to_beta_380 (self , progress ):
906
907
# linux kernel 4.4.21 shipped with Kano 3.8.0 emits systemd boot messages.
907
908
# fix by telling the kernel to enable an empty splash screen.
908
909
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):
934
935
{'kw_app' : 'tux-typing' , 'disk_req' : 26 },
935
936
{'kw_app' : 'libreoffice' , 'disk_req' : 385 },
936
937
]
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 )
937
957
938
958
run_cmd_log ('apt-get autoremove -y' )
939
959
@@ -944,6 +964,7 @@ def beta_370_to_beta_380(self, dummy_progress):
944
964
mb_required = app ['disk_req' ] + 250 # MB buffer
945
965
946
966
if mb_free > mb_required :
967
+ progress .start (app ['kw_app' ])
947
968
run_cmd_log ('kano-apps install --no-gui {app}' .format (app = app ['kw_app' ]))
948
969
else :
949
970
logger .warn (
@@ -964,6 +985,7 @@ def beta_370_to_beta_380(self, dummy_progress):
964
985
)
965
986
finally :
966
987
run_cmd_log ('apt-get clean' )
988
+ progress .start ('continue-postupdate' )
967
989
968
990
# Tell kano-init to put the automatic logins up-to-date
969
991
reconfigure_autostart_policy ()
0 commit comments