在安装时刻关闭安全的模式

This commit is contained in:
wangsong 2022-10-24 15:48:20 +08:00
parent 738a52a3bc
commit e9c2b10619
3 changed files with 5 additions and 2 deletions

View File

@ -64,6 +64,7 @@ class UpdateManager():
self.simulate_mode = SimulateTerminal() self.simulate_mode = SimulateTerminal()
self.install_mode = UpdateInstallMode(self) self.install_mode = UpdateInstallMode(self)
self.apt_p2p_config = AptP2pConfigManager() self.apt_p2p_config = AptP2pConfigManager()
self.safe_manager = UpdateSafeManager()
self._reload_options_config() self._reload_options_config()
self._refresh_cache_only() self._refresh_cache_only()
@ -935,7 +936,7 @@ class UpdateSafeManager():
with open(self.KYSEC_STATUS, 'r') as f: with open(self.KYSEC_STATUS, 'r') as f:
data = f.read() data = f.read()
if data != "0": if data != "0":
self.safe_status = False self.safe_status = True
logging.info("Safe mode is turned on...") logging.info("Safe mode is turned on...")
def _check_safe_exectl(self): def _check_safe_exectl(self):
@ -946,7 +947,7 @@ class UpdateSafeManager():
self.safe_exectl = int(data) self.safe_exectl = int(data)
logging.info("Safe exectl is %s...",data) logging.info("Safe exectl is %s...",data)
def reset_fase(self): def reset_safe(self):
if self.safe_status == True: if self.safe_status == True:
self._set_fun_status(self.safe_exectl) self._set_fun_status(self.safe_exectl)
def shutdown_safe(self): def shutdown_safe(self):

View File

@ -354,6 +354,7 @@ class InstallBackendAptdaemon(InstallBackend):
if progress > 51 and progress < 90 and self.on_install_stage == False: if progress > 51 and progress < 90 and self.on_install_stage == False:
logging.info("The process is now in the installtion phase") logging.info("The process is now in the installtion phase")
self.on_install_stage = True self.on_install_stage = True
self.window_main.safe_manager.shutdown_safe()
self._start_install_lock(_("Kylin System Updater")) self._start_install_lock(_("Kylin System Updater"))
#只处理从下载切换到安装时出现的网络问题 #只处理从下载切换到安装时出现的网络问题

View File

@ -664,6 +664,7 @@ class InstallBackend():
#升级完成后走的分支 #升级完成后走的分支
if action == self.ACTION_INSTALL: if action == self.ACTION_INSTALL:
false_num = 0 false_num = 0
self.window_main.safe_manager.reset_safe()
self._release_install_lock() self._release_install_lock()
self._send_error_code(error_code) self._send_error_code(error_code)