Merge branch 'backend_dev' of gitlab2.kylin.com:kylin-desktop/update-manager-group/kylin-system-updater into backend_dev

This commit is contained in:
wangsong 2021-11-04 20:43:02 +08:00
commit 2ed38648e2
3 changed files with 16 additions and 13 deletions

View File

@ -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))

View File

@ -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))

View File

@ -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"""