From 2feab116e69b039247eb050002ad635008529b4d Mon Sep 17 00:00:00 2001 From: luoxueyi Date: Thu, 4 Nov 2021 20:37:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=86=E7=A6=BB=E5=8D=95=E7=8B=AC=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E4=B8=8E=E5=AE=89=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/SystemUpdater/UpdateManager.py | 4 ++-- backend/SystemUpdater/UpdateManagerDbus.py | 2 +- backend/SystemUpdater/backend/__init__.py | 23 ++++++++++++---------- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/backend/SystemUpdater/UpdateManager.py b/backend/SystemUpdater/UpdateManager.py index 9e83c8f..dd451e5 100644 --- a/backend/SystemUpdater/UpdateManager.py +++ b/backend/SystemUpdater/UpdateManager.py @@ -91,12 +91,12 @@ class UpdateManager(): logging.error(e) # 进行本地deb包安装的操作 - def start_deb_install(self, upgrade_mode, deb_path = "", is_install = False): + def start_deb_install(self, deb_path = "", is_install = False): try: absolute_path, debname = os.path.split(deb_path) logging.info("About to Install Package: %s.",str(debname)) install_backend = get_backend(self, InstallBackend.ACTION_INSTALL_DEB) - install_backend.start(upgrade_mode, partial_upgrade_list = deb_path) + install_backend.start_alone(partial_upgrade_list = deb_path, _is_install = is_install) except Exception as e: logging.info(str(e)) diff --git a/backend/SystemUpdater/UpdateManagerDbus.py b/backend/SystemUpdater/UpdateManagerDbus.py index d58926c..1b0ee96 100755 --- a/backend/SystemUpdater/UpdateManagerDbus.py +++ b/backend/SystemUpdater/UpdateManagerDbus.py @@ -242,7 +242,7 @@ class UpdateManagerDbusController(dbus.service.Object): try: is_install = bool(_is_install) logging.info('method InstallDebFile and is_install:%r...',is_install) - self.parent.start_deb_install(MODE_UPGRADE_PARTIAL,path,is_install) + self.parent.start_deb_install(deb_path = path, is_install = is_install) return True,'success' except Exception as e: logging.error(False, str(e)) diff --git a/backend/SystemUpdater/backend/__init__.py b/backend/SystemUpdater/backend/__init__.py index 245e0b7..56b6f27 100644 --- a/backend/SystemUpdater/backend/__init__.py +++ b/backend/SystemUpdater/backend/__init__.py @@ -130,8 +130,19 @@ class InstallBackend(): self.window_main.dbusController.UpdateDependResloveStatus(_success,is_remove_pkgs,pkgs_remove,raw_description,delete_desc,header,desc) else: self.window_main.dbusController.DistupgradeDependResloveStatus(_success,is_remove_pkgs,pkgs_remove,raw_description,header,desc) + #修复未满足的依赖关系 与apt-get -f install匹配 + elif self.action == self.ACTION_FIX_BROKEN: + self.fix_broken() + #卸载包 + elif self.action == self.ACTION_REMOVE_PACKAGES: + self.purge_packages(partial_upgrade_list) + #更新cache + elif self.action == self.ACTION_UPDATE: + self.update() + + def start_alone(self,partial_upgrade_list = [],_is_install = False): #单独下载功能 - elif self.action == self.ACTION_DOWNLOADONLY: + if self.action == self.ACTION_DOWNLOADONLY: try: self.download_deb(partial_upgrade_list) except Exception as e: @@ -142,15 +153,7 @@ class InstallBackend(): self.install_deb(install_path = partial_upgrade_list, install_force = True) except Exception as e: logging.error(str(e)) - #修复未满足的依赖关系 与apt-get -f install匹配 - elif self.action == self.ACTION_FIX_BROKEN: - self.fix_broken() - #卸载包 - elif self.action == self.ACTION_REMOVE_PACKAGES: - self.purge_packages(partial_upgrade_list) - #更新cache - elif self.action == self.ACTION_UPDATE: - self.update() + def update(self): """Run a update to refresh the package list"""