Merge branch 'backend_manual' into 'backend_uu'

Backend manual

See merge request kylin-desktop/update-manager-group/kylin-system-updater!453
This commit is contained in:
网松 2022-07-07 06:46:31 +00:00
commit f8a0a2d729
7 changed files with 56 additions and 22 deletions

View File

@ -46,21 +46,20 @@ _STRINGS_ERROR = {
PRIORITY_UPGRADE_SUCCCESSED: _("Update Manager upgrade is complete, please restart the control panel before performing the system update"),
#update
ERROR_UPDATE_DEFAULT_FAILED: _("Check for update exceptions,please check your network connection."),
ERROR_UPDATE_SOURCE_FAILED: _("Check for update exceptions,please check your network connection."),
ERROR_NETWORK_FAILED: _("Check for update exceptions,please check your network connection."),
ERROR_UPDATE_KEY_SIGNATURES: _("Check for update exceptions,please check your network connection."),
ERROR_READ_IMPORTANTLIST_FAILED: _("Check for update exceptions,please check your network connection."),
ERROR_SOFTWARE_INDEX_RROKEN: _("Check for update exceptions,please check your network connection."),
ERROR_NOT_INIT_PACKAGESINFIO: _("Check for update exceptions,please check your network connection."),
#优先升级
ERROR_UPDATE_DEFAULT_FAILED: _("Check for update exceptions!"),
ERROR_UPDATE_SOURCE_FAILED: _("Check for update exceptions!"),
ERROR_NETWORK_FAILED: _("Network anomaly, can't check for updates!"),
ERROR_UPDATE_KEY_SIGNATURES: _("Check for update exceptions!"),
ERROR_READ_IMPORTANTLIST_FAILED: _("Check for update exceptions!"),
ERROR_SOFTWARE_INDEX_RROKEN: _("Check for update exceptions!"),
ERROR_NOT_INIT_PACKAGESINFIO: _("Check for update exceptions!"),
ERROR_NOT_FIX_SYSTEM: _("Check for update exceptions!"),
#优先升级
ERROR_NOT_GROUPS_CONFIG: _("Upgrade configuration acquisition exception."),
ERROR_NOT_CONFIGPKG_DEPENDENCIES: _("Upgrade configuration acquisition exception."),
ERROR_NOT_SELFPKG_DEPENDENCIES: _("Priority upgrade status exception."),
ERROR_NOT_FIX_SYSTEM: _("Check for update exceptions,fix system APT environment error."),
#install
ERROR_RESOLVER_FAILED: _("Could not calculate the upgrade"),
ERROR_NOT_UPGRADE_PACKAGES: _("There is an exception in the update package."),

View File

@ -237,7 +237,7 @@ class UpdateManager():
except Exception as e:
logging.error(e)
def start_update_backend(self,update_mode = InstallBackend.MODE_UPDATE_CACHE):
def start_update_backend(self,update_mode = InstallBackend.MODE_UPDATE_ALL):
try:
#调用aptdeamon进行update
update_backend = get_backend(self, InstallBackend.ACTION_UPDATE,update_mode)

View File

@ -484,7 +484,7 @@ class UpdateManagerDbusController(dbus.service.Object):
sender_name = get_proc_from_dbus_name(sender)
logging.info(COLORMETHOR_PREFIX+'Method'+COLORLOG_SUFFIX+' UpdateCache sender:%s...',sender_name)
self._check_prohibit_user(sender_name)
self.parent.start_update_backend()
self.parent.start_update_backend(InstallBackend.MODE_UPDATE_CACHE)
return True,'success'
except Exception as e:
logging.error(str(e))

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]

View File

@ -2629,8 +2629,11 @@ msgstr "依赖关系不满足"
msgid "Disk space is insufficient, please clean the disk and then upgrade"
msgstr "磁盘空间不足,请清理磁盘后进行升级更新"
msgid "Check for update exceptions,please check your network connection."
msgstr "检查更新异常,请检查您的网络连接。"
msgid "Network anomaly, can't check for updates!"
msgstr "网络异常,无法检查更新!"
msgid "Check for update exceptions!"
msgstr "检查更新异常!"
msgid "Check for update exceptions,fix system APT environment error."
msgstr "检查更新异常修复系统APT环境出现错误。"

3
debian/control vendored
View File

@ -41,8 +41,7 @@ Depends: ${python3:Depends},
python3-distro-info,
python3-apscheduler,
python3-pyqt5,
sqlite3,
kylin-update-frontend
sqlite3
Breaks:
Recommends: python3-launchpadlib
Suggests: gir1.2-dbusmenu-glib-0.4,