From 0331b94844dfd8c4971a7d8790f884e59ef733dc Mon Sep 17 00:00:00 2001 From: wangsong Date: Tue, 30 Aug 2022 09:20:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BC=98=E5=85=88=E5=8D=87?= =?UTF-8?q?=E7=BA=A7=E7=9A=84=E6=97=A0=E6=B3=95=E6=98=BE=E7=A4=BA=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/SystemUpdater/UpdateManager.py | 33 ++++++++++++++------------ 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/backend/SystemUpdater/UpdateManager.py b/backend/SystemUpdater/UpdateManager.py index 746e446..a5292a9 100644 --- a/backend/SystemUpdater/UpdateManager.py +++ b/backend/SystemUpdater/UpdateManager.py @@ -258,22 +258,25 @@ class UpdateManager(): for pkg_name in [self.BACKEND_PKG_NAME,self.APTD_PKG_NAME,self.FRONTEND_PKG_NAME]: if pkg_name in cache: self_pkg = cache[pkg_name] - if self_pkg.is_installed and self_pkg.is_upgradable: - logging.info("Check: (%s) will upgrading From %s to %s...",pkg_name,\ - self_pkg.installed.source_version,self_pkg.candidate.source_version) - if pkg_name in important_list: - try: - logging.info("Check: (%s) start upgrading From %s to %s...",pkg_name,\ - self_pkg.installed.source_version,self_pkg.candidate.source_version) - self_pkg.mark_install(True,False,True) - self_upgrade.append(pkg_name) - need_upgrade = True - except SystemError: - self.simulate_mode.thread_install([pkg_name]) - logging.error("Check: mark %s to upgrade Failed...",pkg_name) - raise UpdateBaseError(ERROR_NOT_SELFPKG_DEPENDENCIES) + if self_pkg.is_installed: + if self_pkg.is_upgradable: + logging.info("Check: (%s) will upgrading From %s to %s...",pkg_name,\ + self_pkg.installed.source_version,self_pkg.candidate.source_version) + if pkg_name in important_list: + try: + logging.info("Check: (%s) start upgrading From %s to %s...",pkg_name,\ + self_pkg.installed.source_version,self_pkg.candidate.source_version) + self_pkg.mark_install(True,False,True) + self_upgrade.append(pkg_name) + need_upgrade = True + except SystemError: + self.simulate_mode.thread_install([pkg_name]) + logging.error("Check: mark %s to upgrade Failed...",pkg_name) + raise UpdateBaseError(ERROR_NOT_SELFPKG_DEPENDENCIES) + else: + logging.info("Check: (%s:%s) No need to upgrade and duo to not pust...",pkg_name,self_pkg.installed.source_version) else: - logging.info("Check: (%s:%s) No need to upgrade and duo to not pust...",pkg_name,self_pkg.installed.source_version) + logging.info("Check: (%s:%s) No need to upgrade...",pkg_name,self_pkg.installed.source_version) else: logging.info("Check: (%s) Not to be installed...",pkg_name) else: