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

This commit is contained in:
wangsong 2022-07-08 00:44:18 +08:00
commit 62b32e41d2
3 changed files with 39 additions and 7 deletions

View File

@ -163,6 +163,36 @@ class InstallBackendAptdaemon(InstallBackend):
try:
reinstall = purge = []
trans = yield self.client.commit_packages(
pkgs_install, reinstall, pkgs_remove, purge = purge, upgrade = pkgs_upgrade,
downgrade = pkgs_downgrade,defer=True)
self.window_main.dbusController.transaction = trans
yield self._show_transaction(trans, self.action,
_("Installing updates…"), True)
except errors.NotAuthorizedError:
self._action_done(self.action,
authorized=False, success=False,
error_string='', error_desc='')
except errors.TransactionFailed as e:
self.trans_failed_msg = str(e)
except dbus.DBusException as e:
if e.get_dbus_name() != "org.freedesktop.DBus.Error.NoReply":
raise
self._action_done(self.action,
authorized=False, success=False,
error_string='', error_desc='')
except Exception:
self._action_done(self.action,
is_cancelled=False, success=False,
error_string='', error_desc='')
raise
@inline_callbacks
def commit_only(self,model,pkgs_install, pkgs_upgrade, pkgs_remove,pkgs_downgrade = []):
"""Commit a list of package adds and removes"""
try:
reinstall = purge = []
trans = yield self.client.commit_only(
pkgs_install, reinstall, pkgs_remove, purge = purge, upgrade = pkgs_upgrade,
downgrade = pkgs_downgrade,download = model, defer=True)
self.window_main.dbusController.transaction = trans

View File

@ -176,7 +176,7 @@ class InstallBackend():
self.commit(self.action,pkgs_install, pkgs_upgrade, pkgs_remove,pkgs_downgrade)
elif self.action == self.ACTION_DOWNLOADONLY:
self._update_to_config(self.now_upgrade,pkgs_install,pkgs_upgrade,pkgs_remove)
self.commit(self.action,pkgs_install, pkgs_upgrade, pkgs_remove,pkgs_downgrade)
self.commit_only(self.action,pkgs_install, pkgs_upgrade, pkgs_remove,pkgs_downgrade)
elif self.action == self.ACTION_INSTALL_SHUTDOWN:
self.now_upgrade,pkgs_install,pkgs_upgrade,pkgs_remove = self._config_to_upgrade()
@ -222,15 +222,18 @@ class InstallBackend():
logging.error(str(e))
raise UpdateBaseError(ERROR_RESOLVER_FAILED,desc= str(e))
pkgs_install,pkgs_upgrade,pkgs_remove,pkgs_downgrade = self._get_mark_from_cache(self.cache,self.upgrade_data.adjust_pkgs,self.action_mode)
self.window_main.collector.Generate_Msg(self.now_upgrade.upgrade_groups+self.now_upgrade.single_pkgs, self.action_mode)
for ul in self.window_main.collector.upgrade_list:
self.window_main.collector.Upgrade_Process_Msg(self.action, {"appname":ul})
logging.info("RESOLVER install:%d , upgrade:%d remove:%d pkgs_downgrade:%d",len(pkgs_install),len(pkgs_upgrade),\
len(pkgs_remove),len(pkgs_downgrade))
is_remove_pkgs = len(pkgs_remove) != 0
self.window_main.collector.Generate_Msg(self.now_upgrade.upgrade_groups+self.now_upgrade.single_pkgs, self.action_mode)
errorCode = ""
if is_remove_pkgs:
errorCode = _("Need remove pkgs: ")+", ".join(pkgs_remove)
for ul in self.window_main.collector.upgrade_list:
self.window_main.collector.Upgrade_Process_Msg(self.action, {"appname":ul, "status":is_remove_pkgs, "errorCode":errorCode})
#添加关于删除包的描述信息
for pkg in pkgs_remove:
pkg_obj = self.cache[pkg]

3
debian/control vendored
View File

@ -40,8 +40,7 @@ Depends: ${python3:Depends},
aptdaemon (>=1.1.1+bzr982-0kylin32.3k4.6),
python3-distro-info,
python3-pyqt5,
sqlite3,
kylin-update-frontend
sqlite3
Breaks:
Recommends: python3-launchpadlib
Suggests: gir1.2-dbusmenu-glib-0.4,