From 65ab08d6b31e6a7d0a4b02037448ee794616461a Mon Sep 17 00:00:00 2001 From: wangsong Date: Wed, 24 Nov 2021 15:49:06 +0800 Subject: [PATCH 01/17] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E5=8E=9F=E5=9B=A0=E6=80=BB=E7=BB=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/interface.md | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/backend/interface.md b/backend/interface.md index 6b9743d..1c37a29 100755 --- a/backend/interface.md +++ b/backend/interface.md @@ -208,26 +208,31 @@ +后端日志:`/var/log/kylin-system-updater/kylin-system-updater.log.1` + ### 更新过程报错信息总结 -| 错误信息 | 错误原因 | 解决办法 | -| -------------------- | ---------------------------------- | -------------------------------------------- | -| 下载软件仓库信息失败 | 源存在问题,使用apt update检查 | 检查源是否正确或者检查网络DNS等等 | -| 无法访问源管理服务器 | 源管理服务器存在问题 | 源管理服务器是否通或者检查源服务器与客户端版 | -| 软件索引已经损坏 | 当前系统中cache被破坏,apt无法使用 | 终端检查错误原因进行解决 | -| 无法初始化软件包信息 | apt存在某些问题 | 具体错误原因查看日志相应解决 | -| | | | -| | | | +| 错误信息 | 错误原因 | 解决办法 | +| -------------------- | ------------------------------------- | -------------------------------------------- | +| 下载软件仓库信息失败 | 源存在问题,使用apt update检查 | 检查源是否正确或者检查网络DNS等等 | +| 无法访问源管理服务器 | 源管理服务器存在问题 | 源管理服务器是否通或者检查源服务器与客户端版 | +| 软件索引已经损坏 | 当前系统中cache被破坏,apt无法使用 | 终端检查错误原因进行解决 | +| 无法初始化软件包信息 | apt存在某些问题 | 具体错误原因查看日志相应解决 | +| 无法获取组配置软件包 | 源中不存在kylin-update-desktop-config | 将此包放入源仓库或者写配置文件不强制安装 | +| 无法读取推送升级列表 | 读取推送列表出现问题 | 检查important.list是否存在 | +| | | | ### 安装过程报错信息总结 -| 错误信息 | 错误原因 | 解决办法 | -| ------------------ | ------------------------------ | --------------------------------- | -| 软件包操作失败 | 被升级的软件包有问题 | 检查后端log日志查看那个包存在问题 | -| 下载软件包文件失败 | 网络原因的或者这个软件包的仓库 | 检查网络以及源仓库 | -| | | | +| 错误信息 | 错误原因 | 解决办法 | +| ------------------ | ------------------------------ | ---------------------------------- | +| 软件包操作失败 | 被升级的软件包有问题 | 检查后端log日志查看那个包存在问题 | +| 下载软件包文件失败 | 网络原因的或者这个软件包的仓库 | 检查网络以及源仓库 | +| 磁盘空间不足 | 磁盘的空间不足 | 查看日志那些目录空间不足 | +| 不能计算升级 | 无法计算依赖关系 | 检查日志那个包出现的问题,相应解决 | +| | | | From 2573eb0a0b1e28165783a353b57823328671b339 Mon Sep 17 00:00:00 2001 From: wangsong Date: Wed, 24 Nov 2021 16:25:07 +0800 Subject: [PATCH 02/17] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E5=8E=9F=E5=9B=A0=E6=80=BB=E7=BB=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/interface.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/backend/interface.md b/backend/interface.md index 1c37a29..520edbf 100755 --- a/backend/interface.md +++ b/backend/interface.md @@ -212,15 +212,15 @@ ### 更新过程报错信息总结 -| 错误信息 | 错误原因 | 解决办法 | -| -------------------- | ------------------------------------- | -------------------------------------------- | -| 下载软件仓库信息失败 | 源存在问题,使用apt update检查 | 检查源是否正确或者检查网络DNS等等 | -| 无法访问源管理服务器 | 源管理服务器存在问题 | 源管理服务器是否通或者检查源服务器与客户端版 | -| 软件索引已经损坏 | 当前系统中cache被破坏,apt无法使用 | 终端检查错误原因进行解决 | -| 无法初始化软件包信息 | apt存在某些问题 | 具体错误原因查看日志相应解决 | -| 无法获取组配置软件包 | 源中不存在kylin-update-desktop-config | 将此包放入源仓库或者写配置文件不强制安装 | -| 无法读取推送升级列表 | 读取推送列表出现问题 | 检查important.list是否存在 | -| | | | +| 错误信息 | 错误原因 | 解决办法 | +| -------------------- | ------------------------------------------------------------ | ---------------------------------------- | +| 下载软件仓库信息失败 | 源存在问题,使用apt update检查,若存在报错则更新管理器无问题 | 检查源是否可以使用 | +| 无法访问源管理服务器 | 源管理服务器存在问题 | 源管理服务器是否可用或者检查源服务器配置 | +| 软件索引已经损坏 | 当前系统中cache被破坏,apt无法使用 | 终端检查错误原因进行解决 | +| 无法初始化软件包信息 | apt存在某些问题 | 具体错误原因查看日志相应解决 | +| 无法获取组配置软件包 | 源中不存在kylin-update-desktop-config | 将此包放入源仓库或者写配置文件不强制安装 | +| 无法读取推送升级列表 | 读取推送列表出现问题 | 检查important.list是否存在 | +| 获取软件推送失败 | 老版本文案同 无法访问源管理服务器解决 | | From 00d45c13a215fe15483009cb73787defc7031f93 Mon Sep 17 00:00:00 2001 From: wangsong Date: Wed, 24 Nov 2021 17:09:29 +0800 Subject: [PATCH 03/17] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- debian/control | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/control b/debian/control index ce6fb8c..f43ef69 100644 --- a/debian/control +++ b/debian/control @@ -52,7 +52,8 @@ Depends: ${python3:Depends}, python3-dbus, python3-gi (>= 3.8), python3-yaml, - ukui-control-center (>= 3.1.1+1103) + aptdaemon, + ukui-control-center (>= 3.1.1+1103) Breaks: Recommends: python3-launchpadlib Suggests: gir1.2-dbusmenu-glib-0.4, From a7b65f29337ad22445d50cddc0ec63a09f185916 Mon Sep 17 00:00:00 2001 From: luoxueyi Date: Thu, 25 Nov 2021 09:49:42 +0800 Subject: [PATCH 04/17] version: 1.2.12 --- debian/changelog | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/debian/changelog b/debian/changelog index bb0aaf6..3ce4fed 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,15 @@ +kylin-system-updater (1.2.12kord) v101; urgency=medium + + * BUG: #89818:【系统更新】将系统字体调整为最大,控制面板-更新界面"您的系统已是最新未跟随改变";且界面显示不全 + * #89554:【系统更新】控制面板-更新界面没有兼容ukui3.1 + * #89817:【系统更新】控制面板-更新界面未进行汉化 + * #89810:【系统更新】全部更新缺少错误原因提示,且取消全部下载建议提示下载取消。将依赖冲突的包以虚包形式进行全部更新,提示部分更新失败;空间少于备份空间或者安装包的空间,全部更新后提示部分更新失败。都未展示实际原因 + * 需求号: 无 + * 其他改动说明:增加自主升级功能,优化进度显示保持功能 + * 其他改动影响域: 影响更新检测功能,在更新检测时将更新系统升级包本身 + + -- luoxueyi Wed, 24 Nov 2021 17:41:34 +0800 + kylin-system-updater (1.2.9kord) v101; urgency=medium * BUG: bug#91191,bug#90533,bug#91103,bug#90454,bug#89871 From b9bc2feaddd8bbfec5633ec43807b52d3c95ca42 Mon Sep 17 00:00:00 2001 From: wangsong Date: Thu, 25 Nov 2021 10:21:24 +0800 Subject: [PATCH 05/17] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=8F=96=E6=B6=88?= =?UTF-8?q?=E4=BF=A1=E5=8F=B7=E5=9C=A8=E4=B8=8B=E8=BD=BD=E9=98=B6=E6=AE=B5?= =?UTF-8?q?=E7=9A=84=E9=A2=91=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/SystemUpdater/UpdateManagerDbus.py | 4 ++-- .../backend/InstallBackendAptdaemon.py | 19 ++++++++++++------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/backend/SystemUpdater/UpdateManagerDbus.py b/backend/SystemUpdater/UpdateManagerDbus.py index 6eaa99e..3356659 100755 --- a/backend/SystemUpdater/UpdateManagerDbus.py +++ b/backend/SystemUpdater/UpdateManagerDbus.py @@ -443,8 +443,8 @@ class UpdateManagerDbusController(dbus.service.Object): # 信号是否可取消 @dbus.service.signal(UPDATER_DBUS_INTERFACE, signature='b') def Cancelable(self, Cancelable): - logging.info(COLORLOG_PREFIX + "emit" + COLORLOG_SUFFIX +" Cancelable: %r",\ - Cancelable) + pass + # logging.info(COLORLOG_PREFIX + "emit" + COLORLOG_SUFFIX +" Cancelable: %r",Cancelable) # 插入数据库完成后发送 @dbus.service.signal(UPDATER_DBUS_INTERFACE, signature='ss') diff --git a/backend/SystemUpdater/backend/InstallBackendAptdaemon.py b/backend/SystemUpdater/backend/InstallBackendAptdaemon.py index fcd6424..61dd026 100644 --- a/backend/SystemUpdater/backend/InstallBackendAptdaemon.py +++ b/backend/SystemUpdater/backend/InstallBackendAptdaemon.py @@ -37,8 +37,8 @@ class InstallBackendAptdaemon(InstallBackend): self.static_progress = 0 self.trans_status = '' self.details = '' - self.is_enter_install = False - + self.on_install_stage = False + self.trans_cancelable = False self.last_action_timestamp = time.time() if self.action == self.ACTION_INSTALL: @@ -259,13 +259,15 @@ class InstallBackendAptdaemon(InstallBackend): if self.trans_progress != 100: self.window_main.dbusController.UpdateDetectStatusChanged(progress,status) elif action == self.ACTION_INSTALL: - if progress >= 50 and self.is_enter_install == False: - self.is_enter_install = True + #50%时候 属于下载状态切换到安装状态的过程 + if progress >= 51 and self.on_install_stage == False: + self.on_install_stage = True #进度安装阶段标志位,使用鉴别是否出现安装过程中强制关闭 之后进行修复使用得 self.window_main.configs.setValue("SystemStatus","isabnormalreboot",str(True),True) pass #LockedPreventShutdown() - - #此处发不发信号一样 频率很低 + #在下载阶段发送取消信号 + if self.on_install_stage == False: + self.window_main.dbusController.Cancelable(self.trans_cancelable) self.window_main.dbusController.UpdateDloadAndInstStaChanged(upgrade_content,progress,status,details) # elif action == self.ACTION_FIX_BROKEN: # self.window_main.dbusController.FixBrokenStatusChanged(progress,status) @@ -294,7 +296,10 @@ class InstallBackendAptdaemon(InstallBackend): humanize_size(current_cps)) def _on_cancellable_changed(self, trans, Cancelable): + logging.info("\033[43;1m" + "emit" + "\033[0m" +" Cancelable: %r",Cancelable) self.window_main.dbusController.Cancelable(Cancelable) + #增加取消信号的频发机制 + self.trans_cancelable = Cancelable #增加记录当产生错误的时候 详细信息 def _on_error_changed(self, trans,error_code, error_details): @@ -322,7 +327,7 @@ class InstallBackendAptdaemon(InstallBackend): error_desc = '' #退出 - self.is_enter_install = False + self.on_install_stage = False if status == EXIT_FAILED: error_string = get_error_string_from_enum(trans.error.code) error_desc = get_error_description_from_enum(trans.error.code) From 6992a1950c364e288da3ba354a9c7a884401ab83 Mon Sep 17 00:00:00 2001 From: wangsong Date: Thu, 25 Nov 2021 11:17:29 +0800 Subject: [PATCH 06/17] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=A7=A3=E8=80=A6?= =?UTF-8?q?=EF=BC=8C=E4=BC=98=E5=8C=96=E9=9D=99=E6=80=81=E5=8F=98=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/SystemUpdater/Core/Database.py | 18 ++------- backend/SystemUpdater/UpdateManager.py | 7 ++-- backend/SystemUpdater/UpdateManagerDbus.py | 7 ++-- backend/SystemUpdater/backend/__init__.py | 43 ++++++++++++++-------- 4 files changed, 37 insertions(+), 38 deletions(-) diff --git a/backend/SystemUpdater/Core/Database.py b/backend/SystemUpdater/Core/Database.py index f327da0..dc7601a 100644 --- a/backend/SystemUpdater/Core/Database.py +++ b/backend/SystemUpdater/Core/Database.py @@ -11,21 +11,11 @@ import datetime from gettext import gettext as _ import apt_pkg - +from ..backend import InstallBackend DB_FILE = os.path.join("/var/cache/kylin-system-updater/kylin-system-updater.db") INSTALLED_LIST = [{"item": "errorcode", "type": "int", "default": "0"}] DISPALY_LIST = [] -MODE_DEFAULT_STATUS = -1 -#部分升级 -MODE_UPGRADE_PARTIAL = 0 -#全部升级 -MODE_UPGRADE_ALL = 1 -#系统全盘升级 -MODE_UPGRADE_SYSTEM = 2 -#后端内部安装包使用 -MODE_UPGRADE_SINGLE = 3 - class Sqlite3Server(object): def __init__(self, window_main): self.connect = None @@ -158,7 +148,7 @@ class Sqlite3Server(object): status = 'failed' # 判断更新方式 - if mode == MODE_UPGRADE_PARTIAL: # 部分更新 + if mode == InstallBackend.MODE_UPGRADE_PARTIAL: # 部分更新 pkg_adj = "" # 判断更新包为单包或更新组 if pkg_group: @@ -205,7 +195,7 @@ class Sqlite3Server(object): self.insert_into_updateinfo(pkgname, pkgversion, pkgdescription, timestr, status, "1", errstr) # FIXME: 这里也需要, 发送插入数据库成功的信号 self.window_main.dbusController.UpdateSqlitSingle(pkgname, timestr) - elif mode == MODE_UPGRADE_ALL: # 系统升级 + elif mode == InstallBackend.MODE_UPGRADE_ALL: # 系统升级 # # insert signal deb first for i in pkg_list: try: @@ -239,7 +229,7 @@ class Sqlite3Server(object): self.init_sqlit() self.insert_into_updateinfo(str(i), pkgversion, pkgdescription, timestr, status, "1", errstr) self.window_main.dbusController.UpdateSqlitSingle(str(i), timestr) - elif mode == MODE_UPGRADE_SYSTEM: # 全盘升级 + elif mode == InstallBackend.MODE_UPGRADE_SYSTEM: # 全盘升级 pkgs_install,pkgs_upgrade,pkgs_remove = self.refreshpkglist() pkg_list = list(set(pkgs_upgrade).union(set(pkgs_install))) for i in pkg_list: diff --git a/backend/SystemUpdater/UpdateManager.py b/backend/SystemUpdater/UpdateManager.py index b6a5598..0721f08 100644 --- a/backend/SystemUpdater/UpdateManager.py +++ b/backend/SystemUpdater/UpdateManager.py @@ -22,7 +22,6 @@ from .Core.loop import mainloop import time from gettext import gettext as _ from SystemUpdater.backend import DownloadBackend as downb -from SystemUpdater.Core.Database import MODE_UPGRADE_SINGLE import apt_pkg from SystemUpdater.Core.UpdaterConfigParser import UpgradeConfig @@ -208,7 +207,7 @@ class UpdateManager(): logging.info("Self-Updater(%s) start upgrading...",self.SELF_PKG_NAME) pkg_json.mark_upgrade() - self.start_install(MODE_UPGRADE_SINGLE,True) + self.start_install(InstallBackend.MODE_UPGRADE_SINGLE,True) #直接退出 进行安装程序 _success = False header = self.INSTALL_ALONE_PROGRESS @@ -246,7 +245,7 @@ class UpdateManager(): logging.info("groups JSON ConfigPkgs(%s) start upgrading...",self.GROUPS_PKG_NAME) pkg_json.mark_upgrade() - self.start_install(MODE_UPGRADE_SINGLE,True) + self.start_install(InstallBackend.MODE_UPGRADE_SINGLE,True) #直接退出 _success = False header = self.INSTALL_ALONE_PROGRESS @@ -256,7 +255,7 @@ class UpdateManager(): else: logging.info("groups JSON ConfigPkgs(%s) start new installing...",self.GROUPS_PKG_NAME) pkg_json.mark_install() - self.start_install(MODE_UPGRADE_SINGLE,True) + self.start_install(InstallBackend.MODE_UPGRADE_SINGLE,True) #直接退出 _success = False header = self.INSTALL_ALONE_PROGRESS diff --git a/backend/SystemUpdater/UpdateManagerDbus.py b/backend/SystemUpdater/UpdateManagerDbus.py index 3356659..e5d68ae 100755 --- a/backend/SystemUpdater/UpdateManagerDbus.py +++ b/backend/SystemUpdater/UpdateManagerDbus.py @@ -11,7 +11,6 @@ from .Core.utils import humanize_size from SystemUpdater.Core.utils import ( unLockedEnableShutdown, ) -from SystemUpdater.Core.Database import MODE_UPGRADE_PARTIAL,MODE_UPGRADE_ALL,MODE_UPGRADE_SYSTEM UPDATER_DBUS_INTERFACE = 'com.kylin.systemupgrade.interface' UPDATER_DBUS_PATH = '/com/kylin/systemupgrade' @@ -211,7 +210,7 @@ class UpdateManagerDbusController(dbus.service.Object): return False,'In the process of updating or Upgrading...' else: logging.info(COLORMETHOR_PREFIX+'method'+COLORLOG_SUFFIX+' DistUpgradeAll and is_install:%r...',is_install) - self.parent.start_install(MODE_UPGRADE_ALL,is_install) + self.parent.start_install(InstallBackend.MODE_UPGRADE_ALL,is_install) return True,'success' except Exception as e: return False,str(e) @@ -237,7 +236,7 @@ class UpdateManagerDbusController(dbus.service.Object): new_upgrade_list = list(set(partial_upgrade_list) & set(local_upgrade_groups + local_single_pkgs)) if new_upgrade_list: - self.parent.start_install(MODE_UPGRADE_PARTIAL,is_install,partial_upgrade_list) + self.parent.start_install(InstallBackend.MODE_UPGRADE_PARTIAL,is_install,partial_upgrade_list) return True,'dbus upgrading' else: logging.warning('input upgrade list(%s) not in local upgrade_list(%s)',partial_upgrade_list,local_upgrade_groups+local_single_pkgs) @@ -290,7 +289,7 @@ class UpdateManagerDbusController(dbus.service.Object): return False,'In the process of updating or Upgrading...' else: logging.info(COLORMETHOR_PREFIX+'method'+COLORLOG_SUFFIX+' DistUpgradeSystem and is_install:%r...',is_install) - self.parent.start_install(MODE_UPGRADE_SYSTEM,is_install) + self.parent.start_install(InstallBackend.MODE_UPGRADE_SYSTEM,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 e677fdd..e2277d8 100644 --- a/backend/SystemUpdater/backend/__init__.py +++ b/backend/SystemUpdater/backend/__init__.py @@ -15,7 +15,6 @@ from SystemUpdater.Core.utils import ( check_free_space ) import time -from ..Core.Database import MODE_DEFAULT_STATUS,MODE_UPGRADE_PARTIAL,MODE_UPGRADE_ALL,MODE_UPGRADE_SYSTEM,MODE_UPGRADE_SINGLE class NowUpgradePara: """ @@ -23,9 +22,9 @@ class NowUpgradePara: run """ def __init__(self, - upgrade_groups=[], - upgrade_mode=MODE_DEFAULT_STATUS, - single_pkgs=[], + upgrade_groups, + upgrade_mode, + single_pkgs, ): #组列表中包含的包 self.upgrade_groups = upgrade_groups @@ -47,27 +46,39 @@ class InstallBackend(): ACTION_FIX_INCOMPLETE = 7 ACTION_CLEAN = 8 + #ACTION_INSTALL 的子类 + MODE_DEFAULT_STATUS = -1 + #部分升级 + MODE_UPGRADE_PARTIAL = 0 + #全部升级 + MODE_UPGRADE_ALL = 1 + #系统全盘升级 + MODE_UPGRADE_SYSTEM = 2 + #后端内部安装包使用 + MODE_UPGRADE_SINGLE = 3 + def __init__(self, window_main, action): self.window_main = window_main self.cache = window_main.cache self.action = action + #对所有的操作进行枷锁 当执行完毕后返回到_action_done 进行解锁,除了计算依赖模式 不进入_action_done 单独解锁 + self.window_main.is_working = action + #更新的时候此对象还未生成 if self.window_main.update_list != None: #本地维护的升级列表和需要升级的包 self.upgrade_data = window_main.update_list.local_upgrade_data #要拿到升级列表必须调用_make_upgrade_list - self.now_upgrade = NowUpgradePara([],MODE_DEFAULT_STATUS,[]) + self.now_upgrade = NowUpgradePara([],self.MODE_DEFAULT_STATUS,[]) def start(self,_upgrade_mode = MODE_DEFAULT_STATUS,partial_upgrade_list = []): - #对所有的操作进行枷锁 当执行完毕后返回到_action_done 进行解锁,除了计算依赖模式 不进入_action_done 单独解锁 - self.window_main.is_working = self.action #安装升级包 首先必须调用ACTION_CHECK_RESOLVER 计算依赖解决方便 标记cache 进行升级 if self.action == self.ACTION_INSTALL: self.now_upgrade.upgrade_mode = _upgrade_mode - if _upgrade_mode != MODE_UPGRADE_SINGLE: + if _upgrade_mode != self.MODE_UPGRADE_SINGLE: #拿到升级列表 self.now_upgrade.upgrade_groups,self.now_upgrade.single_pkgs = self._make_groups_list(self.upgrade_data,_upgrade_mode,partial_upgrade_list) @@ -87,7 +98,7 @@ class InstallBackend(): if _success == False: header = _("Disk space is insufficient, please clean the disk and then upgrade") #当单包安装检查内存不够的时候,报错到控制面板 单包安装属于更新才使用的所以直接赋值为更新 再进行之后的报错处理 - if self.now_upgrade.upgrade_mode == MODE_UPGRADE_SINGLE: + if self.now_upgrade.upgrade_mode == self.MODE_UPGRADE_SINGLE: self.action = self.ACTION_UPDATE self._action_done(self.action,True,False,header,desc) @@ -105,7 +116,7 @@ class InstallBackend(): #检查依赖之前 判断是否需要重启aptdeamon self.window_main.restart_aptdeamon() time.sleep(0.5) - if _upgrade_mode != MODE_UPGRADE_SYSTEM: + if _upgrade_mode != self.MODE_UPGRADE_SYSTEM: #获取要升级的组列表 self.now_upgrade.upgrade_groups,self.now_upgrade.single_pkgs = self._make_groups_list(self.upgrade_data,_upgrade_mode,partial_upgrade_list) #获取要升级和安装的包列表 @@ -141,7 +152,7 @@ class InstallBackend(): raw_description.append(getattr(pkg_obj.candidate, "summary", '')) #解锁忙碌 self.window_main.is_working = self.ACTION_DEFUALT_STATUS - if _upgrade_mode != MODE_UPGRADE_SYSTEM: + if _upgrade_mode != self.MODE_UPGRADE_SYSTEM: 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) @@ -210,7 +221,7 @@ class InstallBackend(): pkgs_remove = [] #全盘升级不做任何的调整 修复bug,出现调整版本,报错不需要更新升级退出 - if upgrade_mode == MODE_UPGRADE_SYSTEM: + if upgrade_mode == self.MODE_UPGRADE_SYSTEM: adjust_pkgs = [] else: #获取调整包列表 去掉版本号 @@ -243,7 +254,7 @@ class InstallBackend(): pkg_list = [] #可选升级 - if _upgrade_mode == MODE_UPGRADE_PARTIAL: + if _upgrade_mode == self.MODE_UPGRADE_PARTIAL: for i in partial_upgrade_list: #组升级方式 if i in upgrade_data.upgrade_groups: @@ -255,7 +266,7 @@ class InstallBackend(): logging.warning("this package(%s) not in selected list",i) #全部升级列表 - elif _upgrade_mode == MODE_UPGRADE_ALL: + elif _upgrade_mode == self.MODE_UPGRADE_ALL: groups_list = upgrade_data.upgrade_groups pkg_list = upgrade_data.single_pkgs @@ -459,7 +470,7 @@ class InstallBackend(): error_string, error_desc) if success: #当组列表为空时 表示现在的单独进行安装某些包或卸载,不发信号到控制面板 - if self.now_upgrade.upgrade_mode != MODE_UPGRADE_SINGLE: + if self.now_upgrade.upgrade_mode != self.MODE_UPGRADE_SINGLE: #升级完成后从升级列表删除 for groups in self.now_upgrade.upgrade_groups: self.upgrade_data.upgrade_groups.remove(groups) @@ -476,7 +487,7 @@ class InstallBackend(): self.window_main.start_available() return #当更新过程中安装配置包时 失败时发送错误信号 - elif success == False and self.now_upgrade.upgrade_mode == MODE_UPGRADE_SINGLE: + elif success == False and self.now_upgrade.upgrade_mode == self.MODE_UPGRADE_SINGLE: self.window_main.dbusController.UpdateDetectFinished(success,upgrade_content,error_string+','+error_desc,error_desc) if error_string != '' or error_desc != '': From 6c2b4b2589270df20ad610e69579666c39c446c8 Mon Sep 17 00:00:00 2001 From: wangsong Date: Thu, 25 Nov 2021 16:11:43 +0800 Subject: [PATCH 07/17] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=8B=E8=BD=BD?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E7=9A=84=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/SystemUpdater/UpdateManagerDbus.py | 7 ++++--- backend/SystemUpdater/backend/InstallBackendAptdaemon.py | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/backend/SystemUpdater/UpdateManagerDbus.py b/backend/SystemUpdater/UpdateManagerDbus.py index e5d68ae..9887b28 100755 --- a/backend/SystemUpdater/UpdateManagerDbus.py +++ b/backend/SystemUpdater/UpdateManagerDbus.py @@ -420,9 +420,10 @@ class UpdateManagerDbusController(dbus.service.Object): success,upgrade_group, error_string,error_desc) #发送下载包信息 fix bug 字节大小改成u 无符号32位 - @dbus.service.signal(UPDATER_DBUS_INTERFACE, signature='iiuui') - def UpdateDownloadInfo(self, current_items, total_items, currenty_bytes, total_bytes, current_cps): - logging.info(COLORLOG_PREFIX + "emit" + COLORLOG_SUFFIX +" UpdateDownloadInfo current_items = %d, total_items = %d, currenty_bytes = %s, total_bytes = %s, current_cps = %s/s",\ + @dbus.service.signal(UPDATER_DBUS_INTERFACE, signature='asiiuui') + def UpdateDownloadInfo(self,upgrade_group,current_items, total_items, currenty_bytes, total_bytes, current_cps): + logging.info(COLORLOG_PREFIX + "emit" + COLORLOG_SUFFIX +" UpdateDownloadInfo upgrade_group = %a,current_items = %d, total_items = %d, currenty_bytes = %s, total_bytes = %s, current_cps = %s/s",\ + upgrade_group,\ current_items, total_items, \ humanize_size(currenty_bytes), humanize_size(total_bytes),\ humanize_size(current_cps)) diff --git a/backend/SystemUpdater/backend/InstallBackendAptdaemon.py b/backend/SystemUpdater/backend/InstallBackendAptdaemon.py index 61dd026..c307d3f 100644 --- a/backend/SystemUpdater/backend/InstallBackendAptdaemon.py +++ b/backend/SystemUpdater/backend/InstallBackendAptdaemon.py @@ -284,6 +284,7 @@ class InstallBackendAptdaemon(InstallBackend): def _on_progress_download_changed(self,trans,current_items, total_items, currenty_bytes, total_bytes, current_cps, eta): if self.action == self.ACTION_INSTALL: self.window_main.dbusController.UpdateDownloadInfo(\ + self.now_upgrade.upgrade_groups+self.now_upgrade.single_pkgs,\ current_items, total_items, \ currenty_bytes, total_bytes, \ current_cps) From 22f4fa7c3c6a21fde80be95f0affbaa2539800a9 Mon Sep 17 00:00:00 2001 From: wangsong Date: Thu, 25 Nov 2021 16:23:53 +0800 Subject: [PATCH 08/17] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E7=A0=B4=E6=8D=9F=E5=8C=85=E7=9A=84=E4=BE=9D=E8=B5=96=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E6=8F=8F=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/po/zh_CN.po | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/backend/po/zh_CN.po b/backend/po/zh_CN.po index f29dcd3..79656d5 100644 --- a/backend/po/zh_CN.po +++ b/backend/po/zh_CN.po @@ -2590,4 +2590,32 @@ msgid "Checking network connection" msgstr "检查网络连接中" msgid "Updating Source Template" -msgstr "更新源摸板中" \ No newline at end of file +msgstr "更新源摸板中" + +#: ../aptdaemon/worker/aptworker.py:1353 +msgid "The following packages have unmet dependencies:" +msgstr "下列软件包未满足的依赖关系:" + +#: ../aptdaemon/worker/aptworker.py:1406 +msgid "but it is a virtual package" +msgstr "但是它是虚拟软件包" + +#: ../aptdaemon/worker/aptworker.py:1409 +msgid "but it is not installed" +msgstr "但是 %s 没有安装" + +#: ../aptdaemon/worker/aptworker.py:1411 +msgid "but it is not going to be installed" +msgstr "但是无法安装 %s" + +#. TRANSLATORS: %s is a version number +#: ../aptdaemon/worker/aptworker.py:1415 +#, python-format +msgid "but %s is installed" +msgstr "但是 %s 已经安装" + +#. TRANSLATORS: %s is a version number +#: ../aptdaemon/worker/aptworker.py:1419 +#, python-format +msgid "but %s is to be installed" +msgstr "但是将要安装 %s" \ No newline at end of file From d2da23621d6839cb8f2e13ed4077f13630887153 Mon Sep 17 00:00:00 2001 From: luoxueyi Date: Thu, 25 Nov 2021 16:46:59 +0800 Subject: [PATCH 09/17] version: 1.2.12.1 --- debian/changelog | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/debian/changelog b/debian/changelog index 3ce4fed..ea22acf 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +kylin-system-updater (1.2.12.1kord) v101; urgency=medium + + * BUG: 无 + * 需求号: 无 + * 其他改动说明:增加获取破损包的依赖错误描述,状态保留增加取消功能,优化静态变量 + * 其他改动影响域: + + -- luoxueyi Thu, 25 Nov 2021 16:43:54 +0800 + kylin-system-updater (1.2.12kord) v101; urgency=medium * BUG: #89818:【系统更新】将系统字体调整为最大,控制面板-更新界面"您的系统已是最新未跟随改变";且界面显示不全 From 8dddb264d09f3c1587a998f8a8dc1e9d441ceafb Mon Sep 17 00:00:00 2001 From: wangsong Date: Thu, 25 Nov 2021 17:22:09 +0800 Subject: [PATCH 10/17] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=8A=A5=E9=94=99?= =?UTF-8?q?=E6=97=B6=20=E6=8E=A7=E5=88=B6=E9=9D=A2=E6=9D=BF=E5=87=BA?= =?UTF-8?q?=E7=8E=B0=E6=AE=B5=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/SystemUpdater/UpdateManager.py | 6 +++--- backend/SystemUpdater/UpdateManagerDbus.py | 5 +++++ backend/SystemUpdater/backend/__init__.py | 6 +++--- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/backend/SystemUpdater/UpdateManager.py b/backend/SystemUpdater/UpdateManager.py index 0721f08..ce0a58d 100644 --- a/backend/SystemUpdater/UpdateManager.py +++ b/backend/SystemUpdater/UpdateManager.py @@ -119,7 +119,7 @@ class UpdateManager(): self.dbusController.UpdateDetectStatusChanged(5,_("Checking network connection")) _success,header,desc = self.dbusController.check_connectivity() if _success == False: - self.dbusController.UpdateDetectFinished(_success,[],header,desc) + self.dbusController.DistUpdateDetectFinished(_success,[],header,desc) return #从服务器端更新摸板 @@ -127,7 +127,7 @@ class UpdateManager(): self.dbusController.UpdateDetectStatusChanged(10,_("Updating Source Template")) _success,header,desc = self.dbusController.on_update_important_list() if _success == False: - self.dbusController.UpdateDetectFinished(_success,[],header,desc) + self.dbusController.DistUpdateDetectFinished(_success,[],header,desc) return #调用aptdeamon进行update update_backend = get_backend(self, InstallBackend.ACTION_UPDATE) @@ -187,7 +187,7 @@ class UpdateManager(): if self.update_list != None: upgrade_list = self.update_list.local_upgrade_data.upgrade_groups + self.update_list.local_upgrade_data.single_pkgs #发送更新升级列表完成的标志 - self.dbusController.UpdateDetectFinished(_success,upgrade_list,header,desc) + self.dbusController.DistUpdateDetectFinished(_success,upgrade_list,header,desc) #检查安装完成之后需要重启吗 self.is_reboot_required() #清空cache diff --git a/backend/SystemUpdater/UpdateManagerDbus.py b/backend/SystemUpdater/UpdateManagerDbus.py index 9887b28..71ef4b4 100755 --- a/backend/SystemUpdater/UpdateManagerDbus.py +++ b/backend/SystemUpdater/UpdateManagerDbus.py @@ -401,6 +401,11 @@ class UpdateManagerDbusController(dbus.service.Object): def UpdateDetectStatusChanged(self,progress,status): logging.info(COLORLOG_PREFIX+"emit"+COLORLOG_SUFFIX+" UpdateDetectStatusChanged progress = %d , status = %s",progress,status) + #替代UpdateDetectFinished 分发更新完成信号,为了解决发送空列表时 控制面板出段错误 + def DistUpdateDetectFinished(self, success, upgrade_group,error_string='',error_desc=''): + if success == False and upgrade_group == []: + upgrade_group = [''] + self.UpdateDetectFinished(success,upgrade_group,error_string,error_desc) #更新完成的信号 @dbus.service.signal(UPDATER_DBUS_INTERFACE,signature='basss') def UpdateDetectFinished(self, success, upgrade_group,error_string='',error_desc='',): diff --git a/backend/SystemUpdater/backend/__init__.py b/backend/SystemUpdater/backend/__init__.py index e2277d8..ed82e8c 100644 --- a/backend/SystemUpdater/backend/__init__.py +++ b/backend/SystemUpdater/backend/__init__.py @@ -480,7 +480,7 @@ class InstallBackend(): else: #当单包升级的时候 升级本身时,让程序退出,再重新启动 if self.window_main.SELF_PKG_NAME in self.cache and self.cache[self.window_main.SELF_PKG_NAME] in self.cache.get_changes(): - self.window_main.dbusController.UpdateDetectFinished(False,[self.window_main.SELF_PKG_NAME],"更新管理器升级完成,请重启控制面板进行系统更新",error_desc) + self.window_main.dbusController.DistUpdateDetectFinished(False,[self.window_main.SELF_PKG_NAME],"更新管理器升级完成,请重启控制面板进行系统更新",error_desc) self.window_main.dbusController.Quit(None) else: #只有安装配置文件包 才会走到此处 @@ -488,7 +488,7 @@ class InstallBackend(): return #当更新过程中安装配置包时 失败时发送错误信号 elif success == False and self.now_upgrade.upgrade_mode == self.MODE_UPGRADE_SINGLE: - self.window_main.dbusController.UpdateDetectFinished(success,upgrade_content,error_string+','+error_desc,error_desc) + self.window_main.dbusController.DistUpdateDetectFinished(success,upgrade_content,error_string+','+error_desc,error_desc) if error_string != '' or error_desc != '': logging.info(error_string + error_desc) @@ -503,7 +503,7 @@ class InstallBackend(): #开始生成列表 self.window_main.start_available() else: - self.window_main.dbusController.UpdateDetectFinished(success,[],error_string+','+error_desc,error_desc) + self.window_main.dbusController.DistUpdateDetectFinished(success,[],error_string+','+error_desc,error_desc) elif action == self.ACTION_FIX_BROKEN: logging.warning("fix broken packages is complete...") self.window_main.start_available() From 561232d07972225aa5ea13a29c7fd04b85369d71 Mon Sep 17 00:00:00 2001 From: wangsong Date: Thu, 25 Nov 2021 19:21:14 +0800 Subject: [PATCH 11/17] =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/SystemUpdater/Core/utils.py | 90 +++++++++++++++++++++ backend/SystemUpdater/backend/__init__.py | 95 +---------------------- 2 files changed, 93 insertions(+), 92 deletions(-) diff --git a/backend/SystemUpdater/Core/utils.py b/backend/SystemUpdater/Core/utils.py index f1c8078..ef71562 100644 --- a/backend/SystemUpdater/Core/utils.py +++ b/backend/SystemUpdater/Core/utils.py @@ -475,6 +475,96 @@ def error(parent, summary, message): d.destroy() return False +def get_broken_details(cache,now=False): + """Return a message which provides debugging information about + broken packages. + + This method is basically a Python implementation of apt-get.cc's + ShowBroken. + + Keyword arguments: + trans -- the corresponding transaction + now -- if we check currently broken dependecies or the installation + candidate + """ + msg = _("The following packages have unmet dependencies:") + msg += "\n\n" + for pkg in cache: + if not ((now and pkg.is_now_broken) or + (not now and pkg.is_inst_broken)): + continue + msg += "%s: " % pkg.name + if now: + version = pkg.installed + else: + version = pkg.candidate + indent = " " * (len(pkg.name) + 2) + dep_msg = "" + for dep in version.dependencies: + or_msg = "" + for base_dep in dep.or_dependencies: + if or_msg: + or_msg += "or\n" + or_msg += indent + # Check if it's an important dependency + # See apt-pkg/depcache.cc IsImportantDep + # See apt-pkg/pkgcache.cc IsCritical() + if not (base_dep.rawtype in ["Depends", "PreDepends", + "Obsoletes", "DpkgBreaks", + "Conflicts"] or + (apt_pkg.config.find_b("APT::Install-Recommends", + False) and + base_dep.rawtype == "Recommends") or + (apt_pkg.config.find_b("APT::Install-Suggests", + False) and + base_dep.rawtype == "Suggests")): + continue + # Get the version of the target package + try: + pkg_dep = cache[base_dep.name] + except KeyError: + dep_version = None + else: + if now: + dep_version = pkg_dep.installed + else: + dep_version = pkg_dep.candidate + # We only want to display dependencies which cannot + # be satisfied + if dep_version and not apt_pkg.check_dep(base_dep.version, + base_dep.relation, + version.version): + break + or_msg = "%s: %s " % (base_dep.rawtype, base_dep.name) + if base_dep.version: + or_msg += "(%s %s) " % (base_dep.relation, + base_dep.version) + if cache.is_virtual_package(base_dep.name): + or_msg += _("but it is a virtual package") + elif not dep_version: + if now: + or_msg += _("but it is not installed") + else: + or_msg += _("but it is not going to " + "be installed") + elif now: + # TRANSLATORS: %s is a version number + or_msg += (("but %s is installed") % + dep_version.version) + else: + # TRANSLATORS: %s is a version number + or_msg += (("but %s is to be installed") % + dep_version.version) + else: + # Only append an or-group if at least one of the + # dependencies cannot be satisfied + if dep_msg: + dep_msg += indent + dep_msg += or_msg + dep_msg += "\n" + msg += dep_msg + return msg + def check_free_space(cache): from .DistUpgradeCache import NotEnoughFreeSpaceError err_sum = _("Not enough free disk space") diff --git a/backend/SystemUpdater/backend/__init__.py b/backend/SystemUpdater/backend/__init__.py index ed82e8c..fbe9556 100644 --- a/backend/SystemUpdater/backend/__init__.py +++ b/backend/SystemUpdater/backend/__init__.py @@ -12,7 +12,8 @@ from gettext import gettext as _ import apt_pkg from SystemUpdater.Core.utils import ( unLockedEnableShutdown, - check_free_space + check_free_space, + get_broken_details ) import time @@ -355,100 +356,10 @@ class InstallBackend(): desc = str(e) logging.error(header + desc) - msg = self._get_broken_details(self.cache) + msg = get_broken_details(self.cache) logging.error(msg) return _success,[],[],header,desc - def _get_broken_details(self,cache,now=False): - """Return a message which provides debugging information about - broken packages. - - This method is basically a Python implementation of apt-get.cc's - ShowBroken. - - Keyword arguments: - trans -- the corresponding transaction - now -- if we check currently broken dependecies or the installation - candidate - """ - msg = _("The following packages have unmet dependencies:") - msg += "\n\n" - for pkg in cache: - if not ((now and pkg.is_now_broken) or - (not now and pkg.is_inst_broken)): - continue - msg += "%s: " % pkg.name - if now: - version = pkg.installed - else: - version = pkg.candidate - indent = " " * (len(pkg.name) + 2) - dep_msg = "" - for dep in version.dependencies: - or_msg = "" - for base_dep in dep.or_dependencies: - if or_msg: - or_msg += "or\n" - or_msg += indent - # Check if it's an important dependency - # See apt-pkg/depcache.cc IsImportantDep - # See apt-pkg/pkgcache.cc IsCritical() - if not (base_dep.rawtype in ["Depends", "PreDepends", - "Obsoletes", "DpkgBreaks", - "Conflicts"] or - (apt_pkg.config.find_b("APT::Install-Recommends", - False) and - base_dep.rawtype == "Recommends") or - (apt_pkg.config.find_b("APT::Install-Suggests", - False) and - base_dep.rawtype == "Suggests")): - continue - # Get the version of the target package - try: - pkg_dep = cache[base_dep.name] - except KeyError: - dep_version = None - else: - if now: - dep_version = pkg_dep.installed - else: - dep_version = pkg_dep.candidate - # We only want to display dependencies which cannot - # be satisfied - if dep_version and not apt_pkg.check_dep(base_dep.version, - base_dep.relation, - version.version): - break - or_msg = "%s: %s " % (base_dep.rawtype, base_dep.name) - if base_dep.version: - or_msg += "(%s %s) " % (base_dep.relation, - base_dep.version) - if self.cache.is_virtual_package(base_dep.name): - or_msg += _("but it is a virtual package") - elif not dep_version: - if now: - or_msg += _("but it is not installed") - else: - or_msg += _("but it is not going to " - "be installed") - elif now: - # TRANSLATORS: %s is a version number - or_msg += (("but %s is installed") % - dep_version.version) - else: - # TRANSLATORS: %s is a version number - or_msg += (("but %s is to be installed") % - dep_version.version) - else: - # Only append an or-group if at least one of the - # dependencies cannot be satisfied - if dep_msg: - dep_msg += indent - dep_msg += or_msg - dep_msg += "\n" - msg += dep_msg - return msg - #调用aptdeamon结束之后处理的地方 不管是出错还是正常都在此处理 def _action_done(self, action, authorized, success, error_string,error_desc): self.window_main.is_working = self.ACTION_DEFUALT_STATUS From ad08a33a06e93b6962558b35515dd178ba3d35fb Mon Sep 17 00:00:00 2001 From: wangsong Date: Thu, 25 Nov 2021 20:36:45 +0800 Subject: [PATCH 12/17] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E6=97=B6=E5=80=99=E6=A3=80=E6=B5=8B=E7=B3=BB=E7=BB=9F=E7=8E=AF?= =?UTF-8?q?=E5=A2=83=E6=98=AF=E5=90=A6=E7=A0=B4=E6=8D=9F=E4=BB=A5=E5=8F=8A?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E4=BF=AE=E5=A4=8D=E6=96=B9=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/SystemUpdater/Core/utils.py | 25 ++++++++++++++++++--- backend/SystemUpdater/UpdateManager.py | 27 +++++++++++++++++++++++ backend/SystemUpdater/backend/__init__.py | 2 +- 3 files changed, 50 insertions(+), 4 deletions(-) diff --git a/backend/SystemUpdater/Core/utils.py b/backend/SystemUpdater/Core/utils.py index ef71562..94b2118 100644 --- a/backend/SystemUpdater/Core/utils.py +++ b/backend/SystemUpdater/Core/utils.py @@ -475,7 +475,26 @@ def error(parent, summary, message): d.destroy() return False -def get_broken_details(cache,now=False): +def get_lis_from_cache(cache): + pkgs_install = [] + pkgs_upgrade = [] + pkgs_remove = [] + + #计算修复破损包 方案 需要删除 新装那些包 + for pkg in cache: + try: + if pkg.marked_install : + pkgs_install.append(pkg.name) + elif pkg.marked_upgrade: + pkgs_upgrade.append(pkg.name) + elif pkg.marked_delete: + pkgs_remove.append(pkg.name) + except KeyError: + # pkg missing from fresh_cache can't be modified + pass + return pkgs_install,pkgs_upgrade,pkgs_remove + +def get_broken_details(cache,now=True): """Return a message which provides debugging information about broken packages. @@ -549,11 +568,11 @@ def get_broken_details(cache,now=False): "be installed") elif now: # TRANSLATORS: %s is a version number - or_msg += (("but %s is installed") % + or_msg += (_("but %s is installed") % dep_version.version) else: # TRANSLATORS: %s is a version number - or_msg += (("but %s is to be installed") % + or_msg += (_("but %s is to be installed") % dep_version.version) else: # Only append an or-group if at least one of the diff --git a/backend/SystemUpdater/UpdateManager.py b/backend/SystemUpdater/UpdateManager.py index ce0a58d..b22bbc8 100644 --- a/backend/SystemUpdater/UpdateManager.py +++ b/backend/SystemUpdater/UpdateManager.py @@ -24,6 +24,7 @@ from gettext import gettext as _ from SystemUpdater.backend import DownloadBackend as downb import apt_pkg from SystemUpdater.Core.UpdaterConfigParser import UpgradeConfig +from SystemUpdater.Core.utils import get_broken_details,get_lis_from_cache class UpdateManager(): SELF_PKG_NAME = 'kylin-system-updater' @@ -315,6 +316,8 @@ class UpdateManager(): "message:\n") + str(e) _success = False return _success,header,desc + + self._check_cache_broken(self.cache) #检查出现安装过程异常重启 出现的话 进行异常修复 if self.configs.getWithDefault("SystemStatus", "isabnormalreboot", False) == True: @@ -346,6 +349,30 @@ class UpdateManager(): return os.path.exists(os.path.join(apt_pkg.config.find_dir("Dir"), "var/run/reboot-required")) + def _check_cache_broken(self,cache): + with cache.actiongroup(): + if cache.get_changes(): + cache.clear() + #获取出现破损状态包的数量 + wouldDelete = cache._depcache.broken_count + + if wouldDelete > 0: + #获取那些依赖关系不满足导致的问题 + logging.info(get_broken_details(cache)) + else: + return + + try: + #计算依赖的解决方案 + cache.fix_broken() + except SystemError as e: + logging.error(e) + return + pkgs_install,pkgs_upgrade,pkgs_remove = get_lis_from_cache(cache) + logging.warning("Fix broken Packages is need to install:%a and upgrade:%a and remove:%a",pkgs_install,pkgs_upgrade,pkgs_remove) + + if cache.get_changes(): + cache.clear() def _setup_dbus(self): # check if there is another g-a-i already and if not setup one diff --git a/backend/SystemUpdater/backend/__init__.py b/backend/SystemUpdater/backend/__init__.py index fbe9556..7f42a27 100644 --- a/backend/SystemUpdater/backend/__init__.py +++ b/backend/SystemUpdater/backend/__init__.py @@ -356,7 +356,7 @@ class InstallBackend(): desc = str(e) logging.error(header + desc) - msg = get_broken_details(self.cache) + msg = get_broken_details(self.cache,False) logging.error(msg) return _success,[],[],header,desc From 6e5208fb505cc14fbe0919b4dc361c51639914cb Mon Sep 17 00:00:00 2001 From: wangsong Date: Thu, 25 Nov 2021 20:39:42 +0800 Subject: [PATCH 13/17] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=AF=BC=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/SystemUpdater/backend/InstallBackendAptdaemon.py | 2 +- backend/SystemUpdater/backend/__init__.py | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/backend/SystemUpdater/backend/InstallBackendAptdaemon.py b/backend/SystemUpdater/backend/InstallBackendAptdaemon.py index c307d3f..b14ce87 100644 --- a/backend/SystemUpdater/backend/InstallBackendAptdaemon.py +++ b/backend/SystemUpdater/backend/InstallBackendAptdaemon.py @@ -12,7 +12,7 @@ from aptdaemon.enums import (EXIT_SUCCESS, from SystemUpdater.backend import InstallBackend import logging from gettext import gettext as _ -from ..Core.utils import humanize_size +from SystemUpdater.Core.utils import humanize_size import dbus,time from gi.repository import GLib diff --git a/backend/SystemUpdater/backend/__init__.py b/backend/SystemUpdater/backend/__init__.py index 7f42a27..e336597 100644 --- a/backend/SystemUpdater/backend/__init__.py +++ b/backend/SystemUpdater/backend/__init__.py @@ -3,8 +3,6 @@ """Integration of package managers into SystemUpdater""" -from __future__ import absolute_import - import logging import os from gettext import gettext as _ From 7f2c3fb82c79415afc7935f4e28eec2fda8cc372 Mon Sep 17 00:00:00 2001 From: luoxueyi Date: Thu, 25 Nov 2021 21:48:06 +0800 Subject: [PATCH 14/17] version: 1.2.12.2 --- debian/changelog | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/debian/changelog b/debian/changelog index ea22acf..ce46880 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +kylin-system-updater (1.2.12.2kord) v101; urgency=medium + + * BUG: 无 + * 需求号: 无 + * 其他改动说明:增加获取破损包的依赖错误描述,状态保留增加取消功能,优化静态变量 + * 其他改动影响域: + + -- luoxueyi Thu, 25 Nov 2021 20:44:05 +0800 + kylin-system-updater (1.2.12.1kord) v101; urgency=medium * BUG: 无 From e80384fb514465d02331f73d885e765c76f4de4c Mon Sep 17 00:00:00 2001 From: luoxueyi Date: Thu, 25 Nov 2021 23:06:45 +0800 Subject: [PATCH 15/17] version:1.2.13 --- debian/changelog | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/debian/changelog b/debian/changelog index ce46880..4aecd75 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +kylin-system-updater (1.2.13kord) v101; urgency=medium + + * BUG: #89461:【系统更新】全部更新过程中,点击详情无更新进度;安装过程中点击详情不会显示安装进度 + * 需求号: 无 + * 其他改动说明:增加获取破损包的依赖错误描述,状态保留增加取消功能 + * 其他改动影响域:系统更新 + + -- luoxueyi Thu, 25 Nov 2021 22:46:16 +0800 + kylin-system-updater (1.2.12.2kord) v101; urgency=medium * BUG: 无 From 5eb25ab021e9a4ea3c40f611901400efe0381155 Mon Sep 17 00:00:00 2001 From: luoxueyi Date: Thu, 25 Nov 2021 23:49:13 +0800 Subject: [PATCH 16/17] version: 1.2.13.1 --- debian/changelog | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 4aecd75..7f225e3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,11 +1,24 @@ -kylin-system-updater (1.2.13kord) v101; urgency=medium +kylin-system-updater (1.2.13.1kord) v101; urgency=medium * BUG: #89461:【系统更新】全部更新过程中,点击详情无更新进度;安装过程中点击详情不会显示安装进度 + * #93309:【系统升级】更新过程中,取消按钮置灰无法点击 + * #89535:【更新升级-需求-9002】【系统更新】全部更新-备份及更新过程中需屏蔽单个更新按键 * 需求号: 无 * 其他改动说明:增加获取破损包的依赖错误描述,状态保留增加取消功能 * 其他改动影响域:系统更新 - -- luoxueyi Thu, 25 Nov 2021 22:46:16 +0800 + -- luoxueyi Thu, 25 Nov 2021 23:36:16 +0800 + +kylin-system-updater (1.2.13kord) v101; urgency=medium + + * BUG: #89461:【系统更新】全部更新过程中,点击详情无更新进度;安装过程中点击详情不会显示安装进度 + * #93309:【系统升级】更新过程中,取消按钮置灰无法点击 + * #89535:【更新升级-需求-9002】【系统更新】全部更新-备份及更新过程中需屏蔽单个更新按键 + * 需求号: 无 + * 其他改动说明:增加获取破损包的依赖错误描述,状态保留增加取消功能 + * 其他改动影响域:系统更新 + + -- luoxueyi Thu, 25 Nov 2021 23:36:16 +0800 kylin-system-updater (1.2.12.2kord) v101; urgency=medium From f0f83ef687705984e46bda60915bfed300d896e7 Mon Sep 17 00:00:00 2001 From: wangsong Date: Fri, 26 Nov 2021 14:03:15 +0800 Subject: [PATCH 17/17] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=96=B0=E4=BF=A1?= =?UTF-8?q?=E5=8F=B7=EF=BC=8C=E4=BF=AE=E5=A4=8D=E4=BE=9D=E8=B5=96=E7=9A=84?= =?UTF-8?q?=E4=BF=A1=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/SystemUpdater/UpdateManagerDbus.py | 18 +++++++++--------- .../backend/InstallBackendAptdaemon.py | 10 +++++----- backend/SystemUpdater/backend/__init__.py | 3 ++- 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/backend/SystemUpdater/UpdateManagerDbus.py b/backend/SystemUpdater/UpdateManagerDbus.py index 71ef4b4..aecc3b9 100755 --- a/backend/SystemUpdater/UpdateManagerDbus.py +++ b/backend/SystemUpdater/UpdateManagerDbus.py @@ -408,7 +408,7 @@ class UpdateManagerDbusController(dbus.service.Object): self.UpdateDetectFinished(success,upgrade_group,error_string,error_desc) #更新完成的信号 @dbus.service.signal(UPDATER_DBUS_INTERFACE,signature='basss') - def UpdateDetectFinished(self, success, upgrade_group,error_string='',error_desc='',): + def UpdateDetectFinished(self, success, upgrade_group,error_string='',error_desc=''): logging.info(COLORLOG_PREFIX + "emit"+ COLORLOG_SUFFIX + " UpdateDetectFinished success = %r , upgrade_group = %a, error_string = %s , error_desc = %s ",\ success,upgrade_group,error_string,error_desc) @@ -420,7 +420,7 @@ class UpdateManagerDbusController(dbus.service.Object): #升级完成的信号 @dbus.service.signal(UPDATER_DBUS_INTERFACE,signature='basss') - def UpdateInstallFinished(self, success, upgrade_group,error_string='',error_desc='',): + def UpdateInstallFinished(self, success, upgrade_group,error_string='',error_desc=''): logging.info(COLORLOG_PREFIX + "emit" + COLORLOG_SUFFIX +" UpdateInstallFinished success = %r , upgrade_group = %a, error_string = %s , error_desc = %s ",\ success,upgrade_group, error_string,error_desc) @@ -435,13 +435,13 @@ class UpdateManagerDbusController(dbus.service.Object): #查询解决依赖 信号 @dbus.service.signal(UPDATER_DBUS_INTERFACE,signature='bbasasasss') - def UpdateDependResloveStatus(self, resolver_status, remove_status,remove_pkgs,pkg_raw_description,delete_desc,error_string='',error_desc='',): + def UpdateDependResloveStatus(self, resolver_status, remove_status,remove_pkgs,pkg_raw_description,delete_desc,error_string='',error_desc=''): logging.info(COLORLOG_PREFIX + "emit" + COLORLOG_SUFFIX +" UpdateDependResloveStatus:resolver_status = %r , resolver_status = %r , remove_pkgs = %a,pkg_raw_description = %a ,delete_desc = %s,error_string = %s , error_desc = %s ",\ resolver_status,remove_status,remove_pkgs,pkg_raw_description,delete_desc,error_string,error_desc) #查询dist-upgrade解决依赖 @dbus.service.signal(UPDATER_DBUS_INTERFACE,signature='bbasasss') - def DistupgradeDependResloveStatus(self, resolver_status, remove_status,remove_pkgs,pkg_raw_description,error_string='',error_desc='',): + def DistupgradeDependResloveStatus(self, resolver_status, remove_status,remove_pkgs,pkg_raw_description,error_string='',error_desc=''): logging.info(COLORLOG_PREFIX + "emit" + COLORLOG_SUFFIX +" DistupgradeDependResloveStatus:resolver_status = %r , resolver_status = %r , remove_pkgs = %a,pkg_raw_description = %a ,error_string = %s , error_desc = %s ",\ resolver_status,remove_status,remove_pkgs,pkg_raw_description,error_string,error_desc) @@ -457,8 +457,8 @@ class UpdateManagerDbusController(dbus.service.Object): logging.info(COLORLOG_PREFIX + "emit" + COLORLOG_SUFFIX +" UpdateSqlitSingle: [ %s ]: date: %s .",\ appname, date) - #修复破损包进度信息 0~100 进度信息 101为非预期的信号 - @dbus.service.signal(UPDATER_DBUS_INTERFACE,signature='is') - def FixBrokenStatusChanged(self,progress,status): - logging.info(COLORLOG_PREFIX+"emit"+COLORLOG_SUFFIX+" FixBrokenStatusChanged progress = %d , status = %s",progress,status) - + #更新进度信息 0~100 进度信息 101为非预期的信号 + @dbus.service.signal(UPDATER_DBUS_INTERFACE,signature='iiisss') + def FixBrokenStatusChanged(self,finished,success,progress,status,error_string='',error_desc=''): + logging.info(COLORLOG_PREFIX+"emit"+COLORLOG_SUFFIX+" FixBrokenStatusChanged finished = %r , success = %r,progress = %d , status = %s,error_string = %s , error_desc = %s",\ + finished,success,progress,status,error_string,error_desc) diff --git a/backend/SystemUpdater/backend/InstallBackendAptdaemon.py b/backend/SystemUpdater/backend/InstallBackendAptdaemon.py index b14ce87..2d6b8c1 100644 --- a/backend/SystemUpdater/backend/InstallBackendAptdaemon.py +++ b/backend/SystemUpdater/backend/InstallBackendAptdaemon.py @@ -269,8 +269,8 @@ class InstallBackendAptdaemon(InstallBackend): if self.on_install_stage == False: self.window_main.dbusController.Cancelable(self.trans_cancelable) self.window_main.dbusController.UpdateDloadAndInstStaChanged(upgrade_content,progress,status,details) - # elif action == self.ACTION_FIX_BROKEN: - # self.window_main.dbusController.FixBrokenStatusChanged(progress,status) + elif action == self.ACTION_FIX_BROKEN: + self.window_main.dbusController.FixBrokenStatusChanged(False,True,progress,status,'','') else: logging.info("Other Action:progress = %d , status = %s ,details = %s",progress,status,details) @@ -289,15 +289,15 @@ class InstallBackendAptdaemon(InstallBackend): currenty_bytes, total_bytes, \ current_cps) else: - if self.action == self.ACTION_UPDATE: - return + # if self.action == self.ACTION_UPDATE: + # return logging.info("Other Action:current_items = %d, total_items = %d, currenty_bytes = %s, total_bytes = %s, current_cps = %s/s",\ current_items, total_items, \ humanize_size(currenty_bytes), humanize_size(total_bytes),\ humanize_size(current_cps)) def _on_cancellable_changed(self, trans, Cancelable): - logging.info("\033[43;1m" + "emit" + "\033[0m" +" Cancelable: %r",Cancelable) + logging.info("\033[43;1m" + "emit" + "\033[0m" +" Cancelable: %r",Cancelable) self.window_main.dbusController.Cancelable(Cancelable) #增加取消信号的频发机制 self.trans_cancelable = Cancelable diff --git a/backend/SystemUpdater/backend/__init__.py b/backend/SystemUpdater/backend/__init__.py index e336597..1c85144 100644 --- a/backend/SystemUpdater/backend/__init__.py +++ b/backend/SystemUpdater/backend/__init__.py @@ -414,8 +414,9 @@ class InstallBackend(): else: self.window_main.dbusController.DistUpdateDetectFinished(success,[],error_string+','+error_desc,error_desc) elif action == self.ACTION_FIX_BROKEN: + self.window_main.dbusController.FixBrokenStatusChanged(True,success,100,'',error_string,error_desc) logging.warning("fix broken packages is complete...") - self.window_main.start_available() + # self.window_main.start_available() elif action == self.ACTION_FIX_INCOMPLETE: if success: logging.info("fix incomplete install success.")