diff --git a/backend/SystemUpdater/UpdateManager.py b/backend/SystemUpdater/UpdateManager.py index c87ec26..6220ba0 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 e6423c7..86be013 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"""