From 53e56ad7f595b17678f21cb9b3b01a94d7cc6826 Mon Sep 17 00:00:00 2001 From: wangsong Date: Mon, 25 Oct 2021 10:01:59 +0800 Subject: [PATCH 01/11] =?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 --- SystemUpdater/Core/UpdateList.py | 30 +++++++++--------------------- SystemUpdater/UpdateManager.py | 3 ++- SystemUpdater/backend/__init__.py | 10 ++++++---- 3 files changed, 17 insertions(+), 26 deletions(-) diff --git a/SystemUpdater/Core/UpdateList.py b/SystemUpdater/Core/UpdateList.py index 4331392..c4d25b7 100644 --- a/SystemUpdater/Core/UpdateList.py +++ b/SystemUpdater/Core/UpdateList.py @@ -221,47 +221,35 @@ class UpdateList(): #过滤没有推送的配置文件 if not group_name in group_list: continue - upgrade_pkgs_list = data['upgrade_list'] # hold_pkgs_list = data['hold_list'] - #这个安装升级列表中包含当前系统的cache中没有的包 需要过滤 # remove_pkgs_list = data['remove_list'] #检查包是否在cache中 以及是否已经安装 没有安装的话才添加到列表 new_install_pkgs_list = self._check_pkg_in_cache(cache,data['install_list']) - #此在读important 是需要新安装的标记为install,组中的重合去除 for pkg in new_install_pkgs_list: if cache[pkg].marked_install: new_install_pkgs_list.remove(pkg) - #进行交集 升级列表 upgrade_intersection_pkgs = list(set(pkgs_upgrade) & set(upgrade_pkgs_list)) - #判断当前是否可升级或者新装的包 if len(new_install_pkgs_list) == 0 and len(upgrade_intersection_pkgs) == 0: continue - #在总升级列表中移除这些包 for pkg in upgrade_intersection_pkgs: pkgs_upgrade.remove(pkg) - #3、生成升级的包列表JSON upgrade_pkgs_json = self._make_pkg_info_json(cache,upgrade_intersection_pkgs) - #2、生成安装的软件列表 install_pkgs_json = self._make_pkg_info_json(cache,new_install_pkgs_list) - #输出JSON配置文件 self._make_group_output_json(data,data_yaml,upgrade_pkgs_json,install_pkgs_json) #添加到字典维护的升级列表 - self.local_upgrade_data.upgrade_groups.append(group_name) - self.local_upgrade_data.upgrade_groups_pkgs.update({group_name:{"pkgs_upgrade":upgrade_intersection_pkgs,"pkgs_install":new_install_pkgs_list}}) - logging.info("group(%s) upgrade:%d install:%d",group_name,len(upgrade_intersection_pkgs),len(new_install_pkgs_list)) else: pass @@ -327,7 +315,7 @@ class UpdateList(): try: for pkg in pkg_list: zh_name = '' - groups_base_info = {} + base_info = {} output_json = {} output_config_name = OUTPUT_CONFIG_PATH + pkg + '.json' @@ -344,16 +332,16 @@ class UpdateList(): description_str = getattr(pkg_cache.candidate, "description", '') #4、添加一些基础信息 - groups_base_info.update({"package":pkg}) + base_info.update({"package":pkg}) - groups_base_info.update({"cur_version":getattr(pkg_cache.installed, "version", '')}) - groups_base_info.update({"new_version":getattr(pkg_cache.candidate, "version", '')}) - groups_base_info.update({"name":{"zh_CN":zh_name,"en_US":en_name}}) - groups_base_info.update({"description":{"zh_CN":description_str,"en_US":description_str}}) - groups_base_info.update({"icon":''}) + base_info.update({"cur_version":getattr(pkg_cache.installed, "version", '')}) + base_info.update({"new_version":getattr(pkg_cache.candidate, "version", '')}) + base_info.update({"name":{"zh_CN":zh_name,"en_US":en_name}}) + base_info.update({"description":{"zh_CN":description_str,"en_US":description_str}}) + base_info.update({"icon":''}) #5、添加升级的内容 - output_json.update(groups_base_info) + output_json.update(base_info) if pkg_cache.is_installed: output_json.update({"upgrade_list":pkgs_json}) output_json.update({"install_list":{}}) @@ -399,7 +387,7 @@ class UpdateList(): #不需要升级 全部的软件都是新的 header = _("There are no updates to install.") desc = _('important_list is Empty') - return True,header,desc + return success,header,desc elif success == False: return success,header,desc diff --git a/SystemUpdater/UpdateManager.py b/SystemUpdater/UpdateManager.py index 3bc408b..4988456 100644 --- a/SystemUpdater/UpdateManager.py +++ b/SystemUpdater/UpdateManager.py @@ -97,7 +97,8 @@ class UpdateManager(): self.dbusController.UpdateDetectFinished(_success,upgrade_list,header,desc) #保持清空cache的标记 - self.cache._initDepCache() + if self.cache.get_changes(): + self.cache.clear() #检查安装完成之后需要重启吗 self.is_reboot_required() diff --git a/SystemUpdater/backend/__init__.py b/SystemUpdater/backend/__init__.py index dbd4536..083b2bf 100644 --- a/SystemUpdater/backend/__init__.py +++ b/SystemUpdater/backend/__init__.py @@ -96,7 +96,8 @@ class InstallBackend(): else: # 使用全盘升级 全盘使用dist-upgrade try: - self.cache._initDepCache() + if self.cache.get_changes(): + self.cache.clear() _success = self.cache._depcache.upgrade(True) pkgs_install,pkgs_upgrade,pkgs_remove = self._get_mark_from_cache(self.cache) except Exception as e: @@ -230,7 +231,8 @@ class InstallBackend(): #actiongroup 可以加速计算依赖关系 计算花费的时间将大幅度缩减 with self.cache.actiongroup(): - self.cache._initDepCache() + if self.cache.get_changes(): + self.cache.clear() Fix = apt_pkg.ProblemResolver(self.cache._depcache) all_delete_pkgs = [] @@ -275,8 +277,8 @@ class InstallBackend(): self.window_main.is_upgrading = False unLockedEnableShutdown() #完成后清空cache - self.cache._initDepCache() - + if self.cache.get_changes(): + self.cache.clear() if success: #当组列表为空时 表示现在的单独进行安装某些包或卸载,不发信号到控制面板 if self.now_upgrade.upgrade_mode != MODE_UPGRADE_SINGLE: From 67db88e192d412815070d654243d592d4a2b419a Mon Sep 17 00:00:00 2001 From: luoxueyi Date: Mon, 25 Oct 2021 11:35:56 +0800 Subject: [PATCH 02/11] =?UTF-8?q?=E5=AE=89=E8=A3=85=E6=97=B6=E4=B8=8D?= =?UTF-8?q?=E5=90=AF=E5=8A=A8service?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- debian/postinst | 1 - 1 file changed, 1 deletion(-) diff --git a/debian/postinst b/debian/postinst index 4673254..601d540 100644 --- a/debian/postinst +++ b/debian/postinst @@ -10,4 +10,3 @@ fi cp -r /usr/share/kylin-system-updater/kylin-system-updater.db /var/cache/kylin-system-updater/ systemctl enable kylin-system-updater -systemctl start kylin-system-updater From 6717da64fa50cc31c52ae54ecb84ca0e3fa2ab6d Mon Sep 17 00:00:00 2001 From: wangsong Date: Mon, 25 Oct 2021 11:37:58 +0800 Subject: [PATCH 03/11] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=8D=E6=9D=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SystemUpdater/UpdateManagerDbus.py | 8 ++++---- po/zh_CN.po | 15 +++++++++++++++ 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/SystemUpdater/UpdateManagerDbus.py b/SystemUpdater/UpdateManagerDbus.py index ec28553..7cb2569 100755 --- a/SystemUpdater/UpdateManagerDbus.py +++ b/SystemUpdater/UpdateManagerDbus.py @@ -57,10 +57,10 @@ class UpdateManagerDbusController(dbus.service.Object): if retval == False: #FIXME: 需要处理返回结果 转化成中文 - #获取软件推送失败 - #请检查推送服务器 - header = _("Get software push failure") - desc = _("Please check the push servers") + #获取更新软件推送失败,请稍后再进行尝试更新 + #推送服务器连接异常 + header = _("Failed to get update software push, please try to update again later") + desc = _("Connection exception with push server") logging.warning(header + desc) return retval,header,desc else: diff --git a/po/zh_CN.po b/po/zh_CN.po index 33ebf77..6e3b5f2 100644 --- a/po/zh_CN.po +++ b/po/zh_CN.po @@ -2204,6 +2204,21 @@ msgstr "进行带沙盒 aufs 隔离层的测试升级" msgid "Running partial upgrade" msgstr "运行部分升级" +#: +msgid " Will be deleted Due to Upgrade " +msgstr " 将要被删除,因为升级 " + +#: +msgid " Will be deleted Due to Install " +msgstr " 将要被删除,因为安装 " + +#: +msgid "Failed to get update software push, please try to update again later" +msgstr "获取更新软件推送失败,请稍后再进行尝试更新" + +msgid "Connection exception with push server" +msgstr "推送服务器连接异常" + #: ../update-manager-text:59 msgid "Show description of the package instead of the changelog" msgstr "显示包的说明而不是变更日志" From d5d080d6b728ebee6088c2219b1aaa68676af45a Mon Sep 17 00:00:00 2001 From: wangsong Date: Mon, 25 Oct 2021 13:54:35 +0800 Subject: [PATCH 04/11] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BC=96=E8=AF=91?= =?UTF-8?q?=E7=94=9F=E6=88=90=E7=9A=84=E6=96=87=E4=BB=B6=E7=9A=84=E8=BF=BD?= =?UTF-8?q?=E8=B8=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 - SystemUpdater/UpdateManagerVersion.py | 2 +- build/scripts-3.8/kylin-system-updater | 43 ------- debian/files | 2 - po/kylin-system-updater.pot | 172 ------------------------- 5 files changed, 1 insertion(+), 219 deletions(-) delete mode 100755 build/scripts-3.8/kylin-system-updater delete mode 100644 debian/files delete mode 100644 po/kylin-system-updater.pot diff --git a/.gitignore b/.gitignore index af48654..65c14c4 100755 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,6 @@ __pycache__ .vscode .pybuild build -debian/files debian/.debhelper debian/kylin-system-updater debian/kylin-system-updater.debhelper.log diff --git a/SystemUpdater/UpdateManagerVersion.py b/SystemUpdater/UpdateManagerVersion.py index 4224770..dba3548 100644 --- a/SystemUpdater/UpdateManagerVersion.py +++ b/SystemUpdater/UpdateManagerVersion.py @@ -1 +1 @@ -VERSION = '1.0.4kord' +VERSION = '1.1.7kord' diff --git a/build/scripts-3.8/kylin-system-updater b/build/scripts-3.8/kylin-system-updater deleted file mode 100755 index 417f5c9..0000000 --- a/build/scripts-3.8/kylin-system-updater +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/python3 - -from __future__ import print_function - -from SystemUpdater.UpdateManager import UpdateManager -from gettext import gettext as _ -# import -import logging -from optparse import OptionParser -from dbus.mainloop.glib import DBusGMainLoop -from gi.repository import GLib - -#定义日志的格式 -FORMAT = '%(asctime)-15s %(levelname)s:%(message)s' - -FORMAT_DEBUG = '%(asctime)-15s %(levelname)s(%(filename)s:%(lineno)d):%(message)s' - -if __name__ == "__main__": - - # Begin parsing of options - parser = OptionParser() - parser.add_option ("--no-update", action="store_true", - dest="no_update", default=False, - help=_("Do not check for updates when starting")) - parser.add_option ("", "--debug", action="store_true", default=False, - help=_("Show debug messages")) - - (options, args) = parser.parse_args() - - if options.debug: - logging.basicConfig(format=FORMAT,level=logging.INFO) - else: - logging.basicConfig(format=FORMAT,level=logging.INFO) - - logging.info('kylin-update-manager starting ...') - bus_loop = DBusGMainLoop(set_as_default=True) - - app = UpdateManager(options) - # app.start_update() - - loop = GLib.MainLoop() - loop.run() - \ No newline at end of file diff --git a/debian/files b/debian/files deleted file mode 100644 index f5e02fe..0000000 --- a/debian/files +++ /dev/null @@ -1,2 +0,0 @@ -kylin-system-updater_1.0.4kord_all.deb misc optional -kylin-system-updater_1.0.4kord_arm64.buildinfo misc optional diff --git a/po/kylin-system-updater.pot b/po/kylin-system-updater.pot deleted file mode 100644 index aa436ae..0000000 --- a/po/kylin-system-updater.pot +++ /dev/null @@ -1,172 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , YEAR. -# -#: ../SystemUpdater/UpdateManager.py:75 -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-26 15:21+0800\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"Language: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" - -#: ../SystemUpdater/backend/InstallBackendAptdaemon.py:42 -msgid "Checking for updates…" -msgstr "" - -#: ../SystemUpdater/backend/InstallBackendAptdaemon.py:64 -msgid "Installing updates…" -msgstr "" - -#: ../SystemUpdater/UpdateManager.py:58 -msgid "Not enough free disk space" -msgstr "" - -#: ../SystemUpdater/UpdateManager.py:59 -#, python-format -msgid "" -"The upgrade needs a total of %s free space on disk '%s'. Please free at " -"least an additional %s of disk space on '%s'. %s" -msgstr "" - -#. specific ways to resolve lack of free space -#: ../SystemUpdater/UpdateManager.py:64 -msgid "" -"Remove temporary packages of former installations using 'sudo apt clean'." -msgstr "" - -#: ../SystemUpdater/UpdateManager.py:66 -msgid "" -"You can remove old kernels using 'sudo apt autoremove', and you could also " -"set COMPRESS=xz in /etc/initramfs-tools/initramfs.conf to reduce the size of " -"your initramfs." -msgstr "" - -#: ../SystemUpdater/UpdateManager.py:71 -msgid "" -"Empty your trash and remove temporary packages of former installations using " -"'sudo apt clean'." -msgstr "" - -#: ../SystemUpdater/UpdateManager.py:74 -msgid "Reboot to clean up files in /tmp." -msgstr "" - -#: ../SystemUpdater/UpdateManager.py:173 -msgid "Software index is broken" -msgstr "" - -#: ../SystemUpdater/UpdateManager.py:174 -msgid "" -"It is impossible to install or remove any software. Please use the package " -"manager \"Synaptic\" or run \"sudo apt-get install -f\" in a terminal to fix " -"this issue at first." -msgstr "" - -#: ../SystemUpdater/UpdateManager.py:182 -msgid "Could not initialize the package information" -msgstr "" - -#: ../SystemUpdater/UpdateManager.py:183 -msgid "" -"An unresolvable problem occurred while initializing the package " -"information.\n" -"\n" -"Please report this bug against the 'update-manager' package and include the " -"following error message:\n" -msgstr "" - -#: ../SystemUpdater/UpdateManager.py:258 -msgid "Could not calculate the upgrade" -msgstr "" - -#: ../SystemUpdater/UpdateManager.py:259 -msgid "" -"An unresolvable problem occurred while calculating the upgrade.\n" -"\n" -"Please report this bug against the 'update-manager' package and include the " -"following error message:\n" -msgstr "" - -#: ../SystemUpdater/Core/MyCache.py:388 -msgid "This update does not come from a source that supports changelogs." -msgstr "" - -#: ../SystemUpdater/Core/MyCache.py:394 ../SystemUpdater/Core/MyCache.py:429 -msgid "" -"Failed to download the list of changes. \n" -"Please check your Internet connection." -msgstr "" - -#: ../SystemUpdater/Core/MyCache.py:401 -#, python-format -msgid "" -"Changes for %s versions:\n" -"Installed version: %s\n" -"Available version: %s\n" -"\n" -msgstr "" - -#: ../SystemUpdater/Core/MyCache.py:415 -#, python-format -msgid "" -"The changelog does not contain any relevant changes.\n" -"\n" -"Please use http://launchpad.net/ubuntu/+source/%s/%s/+changelog\n" -"until the changes become available or try again later." -msgstr "" - -#: ../SystemUpdater/Core/MyCache.py:422 -#, python-format -msgid "" -"The list of changes is not available yet.\n" -"\n" -"Please use http://launchpad.net/ubuntu/+source/%s/%s/+changelog\n" -"until the changes become available or try again later." -msgstr "" - -#. Translators: the %s is a distro name, like 'Ubuntu' and 'base' as in -#. the core components and packages. -#: ../SystemUpdater/Core/UpdateList.py:175 -#, python-format -msgid "%s base" -msgstr "" - -#: ../SystemUpdater/Core/UpdateList.py:506 -msgid "read important list failed" -msgstr "" - -#. 不需要升级 全部的软件都是新的 -#: ../SystemUpdater/Core/UpdateList.py:639 -msgid "No software updates are available." -msgstr "" - -#: ../SystemUpdater/Core/UpdateList.py:640 -msgid "important_list is Empty" -msgstr "" - -#. 不需要升级 全部的软件都是新的 -#: ../SystemUpdater/Core/UpdateList.py:669 -msgid "The software on this computer is up to date." -msgstr "" - -#: ../SystemUpdater/Core/filter.py:223 -#, python-format -msgid "Unable to parse %s." -msgstr "" - -#: ../kylin-system-updater:24 -msgid "Do not check for updates when starting" -msgstr "" - -#: ../kylin-system-updater:26 -msgid "Show debug messages" -msgstr "" From a944c3e689c56ba079bbbf5aa061cc57f10da44f Mon Sep 17 00:00:00 2001 From: luoxueyi Date: Mon, 25 Oct 2021 14:56:56 +0800 Subject: [PATCH 05/11] =?UTF-8?q?=E5=9B=BD=E9=99=85=E5=8C=96:=20=E7=8E=8B?= =?UTF-8?q?=E6=9D=BE=E5=88=AB=E5=88=A0=E6=88=91=E7=9A=84...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kylin-system-updater | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kylin-system-updater b/kylin-system-updater index 83fc86f..602e47a 100755 --- a/kylin-system-updater +++ b/kylin-system-updater @@ -10,9 +10,14 @@ import signal import os import sys import fcntl +import gettext from SystemUpdater.Core.LogManager import get_logfile as logfile +gettext.bindtextdomain('kylin-system-updater', '/usr/share/locale') +gettext.textdomain('kylin-system-updater') +_ = gettext.gettext + #定义日志的格式 FORMAT = '%(asctime)-15s %(levelname)s:%(message)s' From 9d0c7cfceb8e6435fd8b7980b8fbbf727ed77748 Mon Sep 17 00:00:00 2001 From: luoxueyi Date: Mon, 25 Oct 2021 15:47:42 +0800 Subject: [PATCH 06/11] =?UTF-8?q?=E6=9B=B4=E6=96=B0po?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- po/zh_CN.po | 357 ++++++++++++++++++++++++---------------------------- 1 file changed, 166 insertions(+), 191 deletions(-) diff --git a/po/zh_CN.po b/po/zh_CN.po index 6e3b5f2..358cdb6 100644 --- a/po/zh_CN.po +++ b/po/zh_CN.po @@ -1,25 +1,21 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. -# Funda Wang , 2005. -# -# YunQiang Su , 2012. +# FIRST AUTHOR , YEAR. # +#, fuzzy msgid "" msgstr "" -"Project-Id-Version: update-manager HEAD\n" +"Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: sebastian.heinlein@web.de\n" "POT-Creation-Date: 2012-06-14 00:53+0100\n" -"PO-Revision-Date: 2012-04-10 10:40+0000\n" -"Last-Translator: Yiding He \n" -"Language-Team: Chinese (simplified) \n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=1; plural=0;\n" -"X-Launchpad-Export-Date: 2012-04-17 13:40+0000\n" -"X-Generator: Launchpad (build 15099)\n" #. TRANSLATORS: download size of small updates, e.g. "250 kB" #: ../DistUpgrade/utils.py:433 ../UpdateManager/Core/utils.py:433 @@ -154,7 +150,7 @@ msgstr "" #: ../DistUpgrade/DistUpgradeCache.py:711 #: ../UpdateManager/UpdateManager.py:1031 msgid "Could not calculate the upgrade" -msgstr "无法计算升级" +msgstr "" #: ../DistUpgrade/DistUpgradeCache.py:762 msgid "Error authenticating some packages" @@ -297,7 +293,7 @@ msgstr "" #: ../DistUpgrade/DistUpgradeController.py:368 #: ../DistUpgrade/DistUpgradeController.py:413 msgid "Can not upgrade" -msgstr "无法升级" +msgstr "" #: ../DistUpgrade/DistUpgradeController.py:369 #, python-format @@ -695,7 +691,7 @@ msgstr "正在搜索废弃的软件" #: ../DistUpgrade/DistUpgradeController.py:1726 msgid "System upgrade is complete." -msgstr "系统升级完成" +msgstr "" #: ../DistUpgrade/DistUpgradeController.py:1775 msgid "The partial upgrade was completed." @@ -1266,7 +1262,7 @@ msgstr "包的删除可能会耗费几小时的时间。 " #. FIXME: this should go into DistUpgradeController #: ../DistUpgrade/DistUpgradeView.py:392 ../UpdateManager/UpdateManager.py:676 msgid "The software on this computer is up to date." -msgstr "此计算机中的软件是最新软件。" +msgstr "" #: ../DistUpgrade/DistUpgradeView.py:393 msgid "" @@ -1324,7 +1320,7 @@ msgstr "升级工具" #: ../DistUpgrade/DistUpgradeFetcherCore.py:268 #: ../UpdateManager/Core/DistUpgradeFetcherCore.py:268 msgid "Failed to fetch" -msgstr "下载失败" +msgstr "" #: ../DistUpgrade/DistUpgradeFetcherCore.py:269 #: ../UpdateManager/Core/DistUpgradeFetcherCore.py:269 @@ -1476,7 +1472,7 @@ msgstr "" #: ../DistUpgrade/DistUpgrade.ui.h:1 msgid "_Cancel Upgrade" -msgstr "取消升级(_C)" +msgstr "" #: ../DistUpgrade/DistUpgrade.ui.h:2 msgid "_Resume Upgrade" @@ -1683,7 +1679,7 @@ msgstr[0] "该更新已下载完毕但未安装。" #: ../UpdateManager/UpdateManager.py:589 msgid "There are no updates to install." -msgstr "没有更新需要安装。" +msgstr "" #: ../UpdateManager/UpdateManager.py:598 msgid "Unknown download size." @@ -1775,7 +1771,7 @@ msgstr "您可能无法检查更新或下载新的更新。" #: ../UpdateManager/UpdateManager.py:1002 msgid "Could not initialize the package information" -msgstr "无法初始化软件包信息" +msgstr "" #: ../UpdateManager/UpdateManager.py:1003 msgid "" @@ -1785,9 +1781,6 @@ msgid "" "Please report this bug against the 'update-manager' package and include the " "following error message:\n" msgstr "" -"初始化包信息时遇到无法解决的问题。\n" -"\n" -"请汇报这个“update-manager”软件包的错误,并且将如下信息包含在报告中:\n" #: ../UpdateManager/UpdateManager.py:1032 msgid "" @@ -1844,7 +1837,7 @@ msgstr "新的 Ubuntu 发行版 %s 可用" #. we assert a clean cache #: ../UpdateManager/UpdateManager.py:1153 msgid "Software index is broken" -msgstr "软件索引已经损坏" +msgstr "" #: ../UpdateManager/UpdateManager.py:1154 msgid "" @@ -1852,8 +1845,6 @@ msgid "" "manager \"Synaptic\" or run \"sudo apt-get install -f\" in a terminal to fix " "this issue at first." msgstr "" -"无法安装或删除任何软件。请使用新立得软件包管理器或在终端运行 \"sudo apt-get " -"install -f\" 来修正这个问题。" #: ../UpdateManager/UnitySupport.py:57 msgid "Check for Updates" @@ -1914,15 +1905,13 @@ msgstr "其它更新 (%s)" #: ../UpdateManager/Core/MyCache.py:325 msgid "This update does not come from a source that supports changelogs." -msgstr "更新不是来源于支持日志变更的源。" +msgstr "" #: ../UpdateManager/Core/MyCache.py:331 ../UpdateManager/Core/MyCache.py:359 msgid "" "Failed to download the list of changes. \n" "Please check your Internet connection." msgstr "" -"无法下载更新列表。 \n" -"请检查您的网络连接。" #: ../UpdateManager/Core/MyCache.py:338 #, python-format @@ -1945,10 +1934,6 @@ msgid "" "Please use http://launchpad.net/ubuntu/+source/%s/%s/+changelog\n" "until the changes become available or try again later." msgstr "" -"变更日志未包含任何有关的更改。\n" -"\n" -"请访问 http://launchpad.net/ubuntu/+source/%s/%s/+changelog\n" -"直到变更可用或再试一遍。" #: ../UpdateManager/Core/MyCache.py:353 #, python-format @@ -1958,10 +1943,6 @@ msgid "" "Please use http://launchpad.net/ubuntu/+source/%s/%s/+changelog\n" "until the changes become available or try again later." msgstr "" -"变更列表尚无法获取。\n" -"\n" -"请使用 http://launchpad.net/ubuntu/+source/%s/%s/+changelog\n" -"直到能够访问该列表或稍后再试。" #: ../UpdateManager/Core/UpdateList.py:51 msgid "Failed to detect distribution" @@ -2204,20 +2185,11 @@ msgstr "进行带沙盒 aufs 隔离层的测试升级" msgid "Running partial upgrade" msgstr "运行部分升级" -#: msgid " Will be deleted Due to Upgrade " -msgstr " 将要被删除,因为升级 " +msgstr "" -#: msgid " Will be deleted Due to Install " -msgstr " 将要被删除,因为安装 " - -#: -msgid "Failed to get update software push, please try to update again later" -msgstr "获取更新软件推送失败,请稍后再进行尝试更新" - -msgid "Connection exception with push server" -msgstr "推送服务器连接异常" +msgstr "" #: ../update-manager-text:59 msgid "Show description of the package instead of the changelog" @@ -2401,180 +2373,183 @@ msgstr "过期的 dpkg 状态条目" msgid "Remove lilo since grub is also installed.(See bug #314004 for details.)" msgstr "由于 grub 已安装,移除 lilo。(详情参见 bug #314004 。)" -#~ msgid "" -#~ "After your package information was updated the essential package '%s' can " -#~ "not be found anymore so a bug reporting process is being started." -#~ msgstr "" -#~ "更新包信息后就已找不到基本包(essential) '%s',因此即将启动错误报告进程。" +msgid "" +"After your package information was updated the essential package '%s' can " +"not be found anymore so a bug reporting process is being started." +msgstr "" +"更新包信息后就已找不到基本包(essential) '%s',因此即将启动错误报告进程。" -#~ msgid "Upgrading Ubuntu to version 12.04" -#~ msgstr "正在将 Ubuntu 升级到 12.04 版" +msgid "Upgrading Ubuntu to version 12.04" +msgstr "正在将 Ubuntu 升级到 12.04 版" -#~ msgid "%(count)s update has been selected." -#~ msgid_plural "%(count)s updates have been selected." -#~ msgstr[0] "已选择 %(count)s 个更新。" +msgid "%(count)s update has been selected." +msgid_plural "%(count)s updates have been selected." +msgstr[0] "已选择 %(count)s 个更新。" -#~ msgid "%(count_str)s %(download_str)s" -#~ msgstr "%(count_str)s %(download_str)s" +msgid "%(count_str)s %(download_str)s" +msgstr "%(count_str)s %(download_str)s" -#~ msgid "Welcome to Ubuntu" -#~ msgstr "欢迎使用 Ubuntu" +msgid "Welcome to Ubuntu" +msgstr "欢迎使用 Ubuntu" -#~ msgid "" -#~ "These software updates have been issued since this version of Ubuntu was " -#~ "released." -#~ msgstr "自正式发布起,Ubuntu 已提供了下列软件更新。" +msgid "" +"These software updates have been issued since this version of Ubuntu was " +"released." +msgstr "自正式发布起,Ubuntu 已提供了下列软件更新。" -#~ msgid "Software updates are available for this computer." -#~ msgstr "当前计算机有可用软件更新。" +msgid "Software updates are available for this computer." +msgstr "当前计算机有可用软件更新。" -#~ msgid "Update Manager" -#~ msgstr "更新管理器" +msgid "Update Manager" +msgstr "更新管理器" -#~ msgid "Starting Update Manager" -#~ msgstr "正在启动更新管理器" +msgid "Starting Update Manager" +msgstr "正在启动更新管理器" -#~ msgid "You are connected via a wireless modem." -#~ msgstr "您在使用无线调制解调器连接网络。" +msgid "You are connected via a wireless modem." +msgstr "您在使用无线调制解调器连接网络。" -#~ msgid "_Install Updates" -#~ msgstr "安装更新(_I)" +msgid "_Install Updates" +msgstr "安装更新(_I)" -#~ msgid "Checking for a new ubuntu release" -#~ msgstr "检查新的 Ubuntu 发行版本" +msgid "Checking for a new ubuntu release" +msgstr "检查新的 Ubuntu 发行版本" -#~ msgid "Your system is up-to-date" -#~ msgstr "您的系统已为最新" +msgid "Your system is up-to-date" +msgstr "您的系统已为最新" -#~ msgid "" -#~ "Fetching and installing the upgrade can take several hours. Once the " -#~ "download has finished, the process cannot be cancelled." -#~ msgstr "获取并安装升级可能会持续几个小时。一旦下载结束,进程将不能被取消。" +msgid "" +"Fetching and installing the upgrade can take several hours. Once the " +"download has finished, the process cannot be cancelled." +msgstr "获取并安装升级可能会持续几个小时。一旦下载结束,进程将不能被取消。" -#~ msgid "" -#~ "If you don't want to install them now, choose \"Update Manager\" from the " -#~ "Administration menu later." -#~ msgstr "" -#~ "如果您不想现在安装,稍后可以在“系统管理”菜单选择“更新管理器”进行安装。" +msgid "" +"If you don't want to install them now, choose \"Update Manager\" from the " +"Administration menu later." +msgstr "如果您不想现在安装,稍后可以在“系统管理”菜单选择“更新管理器”进行安装。" -#~ msgid "" -#~ "This upgrade is running in sandbox (test) mode. All changes are written " -#~ "to '%s' and will be lost on the next reboot.\n" -#~ "\n" -#~ "*No* changes written to a systemdir from now until the next reboot are " -#~ "permanent." -#~ msgstr "" -#~ "这个升级正运行在沙盒(测试)模式下。所有的变更都被写入“%s”并在下次重启时丢" -#~ "失。\n" -#~ "\n" -#~ "从现在起直到下次重启,被写入 systemdir 的变更*不是*永久的。" +msgid "" +"This upgrade is running in sandbox (test) mode. All changes are written to " +"'%s' and will be lost on the next reboot.\n" +"\n" +"*No* changes written to a systemdir from now until the next reboot are " +"permanent." +msgstr "" +"这个升级正运行在沙盒(测试)模式下。所有的变更都被写入“%s”并在下次重启时丢" +"失。\n" +"\n" +"从现在起直到下次重启,被写入 systemdir 的变更*不是*永久的。" -#~ msgid "Software updates are available for this computer" -#~ msgstr "有适合当前系统的软件更新" +msgid "Software updates are available for this computer" +msgstr "有适合当前系统的软件更新" -#~ msgid "There are no updates to install" -#~ msgstr "没有可安装的更新" +msgid "There are no updates to install" +msgstr "没有可安装的更新" -#~ msgid "The update has already been downloaded, but not installed" -#~ msgid_plural "The updates have already been downloaded, but not installed" -#~ msgstr[0] "更新已经下载,但还没有安装。" +msgid "The update has already been downloaded, but not installed" +msgid_plural "The updates have already been downloaded, but not installed" +msgstr[0] "更新已经下载,但还没有安装。" -#~ msgid "" -#~ "You will not get any further security fixes or critical updates. Please " -#~ "upgrade to a later version of Ubuntu Linux." -#~ msgstr "您不会再收到任何安全更新。请升级到更新版本的 Ubuntu。" +msgid "" +"You will not get any further security fixes or critical updates. Please " +"upgrade to a later version of Ubuntu Linux." +msgstr "您不会再收到任何安全更新。请升级到更新版本的 Ubuntu。" -#~ msgid "" -#~ "If you don't want to install them now, choose \"Update Manager\" from " -#~ "Applications later." -#~ msgstr "如果您不想现在安装,可以今后再从应用程序中打开“更新管理器”。" +msgid "" +"If you don't want to install them now, choose \"Update Manager\" from " +"Applications later." +msgstr "如果您不想现在安装,可以今后再从应用程序中打开“更新管理器”。" -#~ msgid "0 kB" -#~ msgstr "0 kB" +msgid "0 kB" +msgstr "0 kB" -#~ msgid "1 kB" -#~ msgstr "1 kB" +msgid "1 kB" +msgstr "1 kB" -#~ msgid "" -#~ "The system was unable to get the prerequisites for the upgrade. The " -#~ "upgrade will abort now and restore the original system state.\n" -#~ "\n" -#~ "Please report this as a bug using the command 'ubuntu-bug update-manager' " -#~ "in a terminal and include the files in /var/log/dist-upgrade/ in the bug " -#~ "report." -#~ msgstr "" -#~ "系统无法获取升级所必需的文件。将放弃升级并恢复到原始系统状态。\n" -#~ "\n" -#~ "请在终端里输入命令‘ubuntu-bug update-manager’来报告这个 bug。在报告 bug 时" -#~ "附上位于 /var/log/dist-upgrade/ 的文件。" +msgid "" +"The system was unable to get the prerequisites for the upgrade. The upgrade " +"will abort now and restore the original system state.\n" +"\n" +"Please report this as a bug using the command 'ubuntu-bug update-manager' in " +"a terminal and include the files in /var/log/dist-upgrade/ in the bug report." +msgstr "" +"系统无法获取升级所必需的文件。将放弃升级并恢复到原始系统状态。\n" +"\n" +"请在终端里输入命令‘ubuntu-bug update-manager’来报告这个 bug。在报告 bug 时附" +"上位于 /var/log/dist-upgrade/ 的文件。" -#~ msgid "" -#~ "After your package information was updated the essential package '%s' can " -#~ "not be found anymore.\n" -#~ "This indicates a serious error, please report this bug using the command " -#~ "'ubuntu-bug update-manager' in a terminal and include the files in /var/" -#~ "log/dist-upgrade/ in the bug report." -#~ msgstr "" -#~ "在更新了您的软件包信息之后,系统找不到‘%s’这个必需的软件包。\n" -#~ "这预示着一个严重错误。在终端里输入命令‘ubuntu-bug update-manager’来报告这" -#~ "个 bug。在报告 bug 时附上位于 /var/log/dist-upgrade/ 的文件。" +msgid "" +"After your package information was updated the essential package '%s' can " +"not be found anymore.\n" +"This indicates a serious error, please report this bug using the command " +"'ubuntu-bug update-manager' in a terminal and include the files in /var/log/" +"dist-upgrade/ in the bug report." +msgstr "" +"在更新了您的软件包信息之后,系统找不到‘%s’这个必需的软件包。\n" +"这预示着一个严重错误。在终端里输入命令‘ubuntu-bug update-manager’来报告这个 " +"bug。在报告 bug 时附上位于 /var/log/dist-upgrade/ 的文件。" -#~ msgid "Your graphics hardware may not be fully supported in Ubuntu 11.04." -#~ msgstr "您的显卡可能无法完整地被 Ubuntu 11.04 支持。" +msgid "Your graphics hardware may not be fully supported in Ubuntu 11.04." +msgstr "您的显卡可能无法完整地被 Ubuntu 11.04 支持。" -#~ msgid "" -#~ "The support in Ubuntu 11.04 for your intel graphics hardware is limited " -#~ "and you may encounter problems after the upgrade. Do you want to continue " -#~ "with the upgrade?" -#~ msgstr "" -#~ "Ubuntu 11.04 对您的 intel 显卡支持有限。您可能在升级之后会遇到问题,确定要" -#~ "继续升级吗?" +msgid "" +"The support in Ubuntu 11.04 for your intel graphics hardware is limited and " +"you may encounter problems after the upgrade. Do you want to continue with " +"the upgrade?" +msgstr "" +"Ubuntu 11.04 对您的 intel 显卡支持有限。您可能在升级之后会遇到问题,确定要继" +"续升级吗?" -#~ msgid "" -#~ "\n" -#~ "\n" -#~ "Please report this bug using the command 'ubuntu-bug update-manager' in a " -#~ "terminal and include the files in /var/log/dist-upgrade/ in the bug " -#~ "report.\n" -#~ "%s" -#~ msgstr "" -#~ "\n" -#~ "\n" -#~ "请在终端里输入命令‘ubuntu-bug update-manager’来报告这个 bug。在报告 bug 时" -#~ "附上位于 /var/log/dist-upgrade/ 的文件。\n" -#~ "%s" +msgid "" +"\n" +"\n" +"Please report this bug using the command 'ubuntu-bug update-manager' in a " +"terminal and include the files in /var/log/dist-upgrade/ in the bug report.\n" +"%s" +msgstr "" +"\n" +"\n" +"请在终端里输入命令‘ubuntu-bug update-manager’来报告这个 bug。在报告 bug 时附" +"上位于 /var/log/dist-upgrade/ 的文件。\n" +"%s" -#~ msgid "" -#~ "Preparing the system for the upgrade failed. Please report this using the " -#~ "command 'ubuntu-bug update-manager' in a terminal and include the files " -#~ "in /var/log/dist-upgrade/ in the bug report." -#~ msgstr "" -#~ "无法获取要升级的系统。请在终端里输入命令‘ubuntu-bug update-manager’来报告" -#~ "这个 bug。在报告 bug 时附上位于 /var/log/dist-upgrade/ 的文件。" +msgid "" +"Preparing the system for the upgrade failed. Please report this using the " +"command 'ubuntu-bug update-manager' in a terminal and include the files in /" +"var/log/dist-upgrade/ in the bug report." +msgstr "" +"无法获取要升级的系统。请在终端里输入命令‘ubuntu-bug update-manager’来报告这" +"个 bug。在报告 bug 时附上位于 /var/log/dist-upgrade/ 的文件。" -#~ msgid "" -#~ "Upgrading the repository information resulted in a invalid file. Please " -#~ "report this as a bug using the command 'ubuntu-bug update-manager' in a " -#~ "terminal." -#~ msgstr "" -#~ "升级目录信息得到一个非法的文件。请在终端里输入命令‘ubuntu-bug update-" -#~ "manager’来报告这个 bug。" +msgid "" +"Upgrading the repository information resulted in a invalid file. Please " +"report this as a bug using the command 'ubuntu-bug update-manager' in a " +"terminal." +msgstr "" +"升级目录信息得到一个非法的文件。请在终端里输入命令‘ubuntu-bug update-" +"manager’来报告这个 bug。" -#~ msgid "" -#~ "These software updates have been issued since this version of Ubuntu was " -#~ "released. If you don't want to install them now, choose \"Update Manager" -#~ "\" from Applications later." -#~ msgstr "" -#~ "这些软件的更新在该版本的 Ubuntu 发行之后被证明有问题。如果您不想现在安装它" -#~ "们,可以在稍后从系统应用“更新管理器”中选择安装。" +msgid "" +"These software updates have been issued since this version of Ubuntu was " +"released. If you don't want to install them now, choose \"Update Manager\" " +"from Applications later." +msgstr "" +"这些软件的更新在该版本的 Ubuntu 发行之后被证明有问题。如果您不想现在安装它" +"们,可以在稍后从系统应用“更新管理器”中选择安装。" -#~ msgid "" -#~ "These software updates have been issued since this version of Ubuntu was " -#~ "released. If you don't want to install them now, choose \"Update Manager" -#~ "\" from the Administration Menu later." -#~ msgstr "" -#~ "这些软件的更新在该版本的 Ubuntu 发行之后被证明有问题。如果您不想现在安装它" -#~ "们,可以在稍后从管理员菜单“更新管理器”中选择安装。" +msgid "" +"These software updates have been issued since this version of Ubuntu was " +"released. If you don't want to install them now, choose \"Update Manager\" " +"from the Administration Menu later." +msgstr "" +"这些软件的更新在该版本的 Ubuntu 发行之后被证明有问题。如果您不想现在安装它" +"们,可以在稍后从管理员菜单“更新管理器”中选择安装。" -#~ msgid "%.0f kB" -#~ msgstr "%.0f kB" +msgid "%.0f kB" +msgstr "%.0f kB" + +msgid "Failed to get update software push, please try to update again later" +msgstr "获取更新软件推送失败,请稍后再进行尝试更新" + +msgid "Connection exception with push server" +msgstr "推送服务器连接异常" From 6f8bdd342f22b2fda36620a0c47d9757164ea0da Mon Sep 17 00:00:00 2001 From: wangsong Date: Mon, 25 Oct 2021 17:27:39 +0800 Subject: [PATCH 07/11] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=AF=8D=E6=9D=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SystemUpdater/Core/UpdateList.py | 6 ++-- SystemUpdater/UpdateManagerDbus.py | 3 -- .../backend/InstallBackendAptdaemon.py | 4 +-- po/zh_CN.po | 31 ++++++++++++++----- 4 files changed, 27 insertions(+), 17 deletions(-) diff --git a/SystemUpdater/Core/UpdateList.py b/SystemUpdater/Core/UpdateList.py index c4d25b7..9d4a6a1 100644 --- a/SystemUpdater/Core/UpdateList.py +++ b/SystemUpdater/Core/UpdateList.py @@ -384,9 +384,8 @@ class UpdateList(): #important_list 为空时此次不需要升级 if success == True and not group_important_list and not self.local_upgrade_data.single_pkgs: - #不需要升级 全部的软件都是新的 - header = _("There are no updates to install.") - desc = _('important_list is Empty') + header = _("The software on this computer is up to date.") + desc = "" return success,header,desc elif success == False: return success,header,desc @@ -404,7 +403,6 @@ class UpdateList(): if self.local_upgrade_data.upgrade_groups or self.local_upgrade_data.single_pkgs: return True,header,desc else: - #不需要升级 全部的软件都是新的 header = _("The software on this computer is up to date.") desc = '' return True,header,desc diff --git a/SystemUpdater/UpdateManagerDbus.py b/SystemUpdater/UpdateManagerDbus.py index 0b70c02..34a1a92 100755 --- a/SystemUpdater/UpdateManagerDbus.py +++ b/SystemUpdater/UpdateManagerDbus.py @@ -56,9 +56,6 @@ class UpdateManagerDbusController(dbus.service.Object): return False,header,desc if retval == False: - #FIXME: 需要处理返回结果 转化成中文 - #获取更新软件推送失败,请稍后再进行尝试更新 - #推送服务器连接异常 header = _("Failed to get update software push, please try to update again later") desc = _("Connection exception with push server") logging.warning(header + desc) diff --git a/SystemUpdater/backend/InstallBackendAptdaemon.py b/SystemUpdater/backend/InstallBackendAptdaemon.py index eaeade2..cb634cc 100644 --- a/SystemUpdater/backend/InstallBackendAptdaemon.py +++ b/SystemUpdater/backend/InstallBackendAptdaemon.py @@ -68,8 +68,8 @@ class InstallBackendAptdaemon(InstallBackend): self._action_done(self.ACTION_INSTALL, authorized=True, success=False, #FIXME: 安装超时退出 - error_string=_('Installtion timeout to Exit'), - error_desc=_("Due to inactivity")) + error_string=_("Could not install the upgrades"), + error_desc=_("Installtion timeout to exit Due to inactivity")) self.window_main.dbusController.Quit(None) return False diff --git a/po/zh_CN.po b/po/zh_CN.po index 358cdb6..a2e2be6 100644 --- a/po/zh_CN.po +++ b/po/zh_CN.po @@ -150,7 +150,7 @@ msgstr "" #: ../DistUpgrade/DistUpgradeCache.py:711 #: ../UpdateManager/UpdateManager.py:1031 msgid "Could not calculate the upgrade" -msgstr "" +msgstr "不能计算升级" #: ../DistUpgrade/DistUpgradeCache.py:762 msgid "Error authenticating some packages" @@ -293,7 +293,7 @@ msgstr "" #: ../DistUpgrade/DistUpgradeController.py:368 #: ../DistUpgrade/DistUpgradeController.py:413 msgid "Can not upgrade" -msgstr "" +msgstr "不能升级" #: ../DistUpgrade/DistUpgradeController.py:369 #, python-format @@ -691,7 +691,7 @@ msgstr "正在搜索废弃的软件" #: ../DistUpgrade/DistUpgradeController.py:1726 msgid "System upgrade is complete." -msgstr "" +msgstr "系统升级完成。" #: ../DistUpgrade/DistUpgradeController.py:1775 msgid "The partial upgrade was completed." @@ -1262,7 +1262,7 @@ msgstr "包的删除可能会耗费几小时的时间。 " #. FIXME: this should go into DistUpgradeController #: ../DistUpgrade/DistUpgradeView.py:392 ../UpdateManager/UpdateManager.py:676 msgid "The software on this computer is up to date." -msgstr "" +msgstr "此计算机软件是最新的" #: ../DistUpgrade/DistUpgradeView.py:393 msgid "" @@ -1320,7 +1320,7 @@ msgstr "升级工具" #: ../DistUpgrade/DistUpgradeFetcherCore.py:268 #: ../UpdateManager/Core/DistUpgradeFetcherCore.py:268 msgid "Failed to fetch" -msgstr "" +msgstr "下载失败" #: ../DistUpgrade/DistUpgradeFetcherCore.py:269 #: ../UpdateManager/Core/DistUpgradeFetcherCore.py:269 @@ -1472,7 +1472,7 @@ msgstr "" #: ../DistUpgrade/DistUpgrade.ui.h:1 msgid "_Cancel Upgrade" -msgstr "" +msgstr "取消升级" #: ../DistUpgrade/DistUpgrade.ui.h:2 msgid "_Resume Upgrade" @@ -2186,10 +2186,10 @@ msgid "Running partial upgrade" msgstr "运行部分升级" msgid " Will be deleted Due to Upgrade " -msgstr "" +msgstr " 将要被删除,由于升级 " msgid " Will be deleted Due to Install " -msgstr "" +msgstr " 将要被删除,由于安装 " #: ../update-manager-text:59 msgid "Show description of the package instead of the changelog" @@ -2553,3 +2553,18 @@ msgstr "获取更新软件推送失败,请稍后再进行尝试更新" msgid "Connection exception with push server" msgstr "推送服务器连接异常" + +msgid "update important list occur Exception" +msgstr "获取推送出现异常" + +msgid "You need to be root to run this application" +msgstr "你需要root权限运行" + +msgid "There are no packages that need to be upgraded and installed" +msgstr "没有需要升级和安装的包" + +msgid "Check if the upgrade package does not exist for this upgrade" +msgstr "检查升级包是否不存在本次升级" + +msgid "read important list failed" +msgstr "读取推送升级列表失败" From b4bc6321eb60ff28a7d22f7c1caaa30fa29d00d5 Mon Sep 17 00:00:00 2001 From: wangsong Date: Tue, 26 Oct 2021 10:40:52 +0800 Subject: [PATCH 08/11] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8A=9F=E8=83=BD=20?= =?UTF-8?q?=E6=89=93=E5=BC=80=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SystemUpdater/UpdateManager.py | 2 +- SystemUpdater/UpdateManagerDbus.py | 2 +- SystemUpdater/backend/__init__.py | 4 ++-- kylin-system-updater | 10 ++++------ po/zh_CN.po | 4 ++-- 5 files changed, 10 insertions(+), 12 deletions(-) diff --git a/SystemUpdater/UpdateManager.py b/SystemUpdater/UpdateManager.py index 437d092..4c21a47 100644 --- a/SystemUpdater/UpdateManager.py +++ b/SystemUpdater/UpdateManager.py @@ -188,7 +188,7 @@ class UpdateManager(): header = _("Could not initialize the package information") desc = _("An unresolvable problem occurred while " "initializing the package information.\n\n" - "Please report this bug against the 'update-manager' " + "Please report this bug against the 'kylin-system-updater' " "package and include the following error " "message:\n") + str(e) _success = False diff --git a/SystemUpdater/UpdateManagerDbus.py b/SystemUpdater/UpdateManagerDbus.py index 34a1a92..df1b71a 100755 --- a/SystemUpdater/UpdateManagerDbus.py +++ b/SystemUpdater/UpdateManagerDbus.py @@ -241,7 +241,7 @@ 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='',): - logging.info("emit UpdateDependResloveStatus:resolver_status = %r , resolver_status = %r , remove_pkgs = %a,pkg_raw_description = %a ,delete_desc = %a,error_string = %s , error_desc = %s ",\ + logging.info("emit 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解决依赖 diff --git a/SystemUpdater/backend/__init__.py b/SystemUpdater/backend/__init__.py index 117dc64..c3cf9ed 100644 --- a/SystemUpdater/backend/__init__.py +++ b/SystemUpdater/backend/__init__.py @@ -270,7 +270,7 @@ class InstallBackend(): header = _("Could not calculate the upgrade") desc = _("An unresolvable problem occurred while " "calculating the upgrade.\n\n" - "Please report this bug against the 'update-manager' " + "Please report this bug against the 'kylin-system-updater' " "package and include the following error " "message:\n") + str(e) logging.error(header + desc) @@ -305,7 +305,7 @@ class InstallBackend(): # 信息插入数据库 and 发送信号 if error_string != '' or error_desc != '': - logging.error(error_string + error_desc) + logging.info(error_string + error_desc) self.window_main.sqlite3_server.insert_info(self.now_upgrade.upgrade_mode,self.now_upgrade.single_pkgs,self.now_upgrade.upgrade_groups,success,error_string,error_desc) self.window_main.dbusController.UpdateDownloadFinished(success,upgrade_content,error_string,error_desc) diff --git a/kylin-system-updater b/kylin-system-updater index 602e47a..f3d90f7 100755 --- a/kylin-system-updater +++ b/kylin-system-updater @@ -58,12 +58,10 @@ if __name__ == "__main__": signal.signal(signal.SIGHUP, signal.SIG_IGN) signal.signal(signal.SIGINT,signal_handler_term) - logging.basicConfig(format=FORMAT,level=logging.DEBUG) - -# if options.debug: -# logging.basicConfig(format=FORMAT,level=logging.DEBUG) -# else: -# logging.basicConfig(format=FORMAT,level=logging.INFO,filename = logfile(),filemode = 'a') + if options.debug: + logging.basicConfig(format=FORMAT,level=logging.DEBUG) + else: + logging.basicConfig(format=FORMAT,level=logging.INFO,filename = logfile(),filemode = 'a') if os.getuid() != 0: print(_("You need to be root to run this application")) diff --git a/po/zh_CN.po b/po/zh_CN.po index a2e2be6..817dc6a 100644 --- a/po/zh_CN.po +++ b/po/zh_CN.po @@ -1778,7 +1778,7 @@ msgid "" "An unresolvable problem occurred while initializing the package " "information.\n" "\n" -"Please report this bug against the 'update-manager' package and include the " +"Please report this bug against the 'kylin-system-updater' package and include the " "following error message:\n" msgstr "" @@ -1786,7 +1786,7 @@ msgstr "" msgid "" "An unresolvable problem occurred while calculating the upgrade.\n" "\n" -"Please report this bug against the 'update-manager' package and include the " +"Please report this bug against the 'kylin-system-updater' package and include the " "following error message:" msgstr "" "在计算升级时遇到一个无法解决的问题。\n" From 3929a8700900d11a643fdf972879393e31149201 Mon Sep 17 00:00:00 2001 From: wangsong Date: Tue, 26 Oct 2021 11:22:40 +0800 Subject: [PATCH 09/11] =?UTF-8?q?=E4=BF=AE=E6=94=B9=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 --- SystemUpdater/Core/UpdateList.py | 2 +- SystemUpdater/UpdateManager.py | 9 ++++++--- po/zh_CN.po | 12 ++++++++++-- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/SystemUpdater/Core/UpdateList.py b/SystemUpdater/Core/UpdateList.py index 9d4a6a1..416c1bd 100644 --- a/SystemUpdater/Core/UpdateList.py +++ b/SystemUpdater/Core/UpdateList.py @@ -378,7 +378,7 @@ class UpdateList(): #源过滤 # fu = filter.UpdateListFilterCache() - # allowed_origin_upgrade_pkgs = fu.check_in_allowed_origin(pkgs_upgrade) + # pkgs_upgrade = fu.check_in_allowed_origin(pkgs_upgrade) success,group_important_list,self.local_upgrade_data.single_pkgs,header,desc = self._read_important_list(cache,pkgs_upgrade) diff --git a/SystemUpdater/UpdateManager.py b/SystemUpdater/UpdateManager.py index 4c21a47..a15c3c5 100644 --- a/SystemUpdater/UpdateManager.py +++ b/SystemUpdater/UpdateManager.py @@ -100,7 +100,7 @@ class UpdateManager(): _success,header,desc = self.refresh_cache() #特殊情况的处理 单独安装包需要直接退出 安装or卸载执行完毕后 还会调到start_available - if _success == False and header == INSTALL_ALONE_PROGRESS: + if _success == True and header == INSTALL_ALONE_PROGRESS: return else: upgrade_list = self.update_list.local_upgrade_data.upgrade_groups + self.update_list.local_upgrade_data.single_pkgs @@ -129,7 +129,7 @@ class UpdateManager(): self.start_install(MODE_UPGRADE_SINGLE,True) #直接退出 - _success = False + _success = True header = INSTALL_ALONE_PROGRESS return _success,header,desc else: @@ -139,15 +139,18 @@ class UpdateManager(): pkg_json.mark_install() self.start_install(MODE_UPGRADE_SINGLE,True) #直接退出 - _success = False + _success = True header = INSTALL_ALONE_PROGRESS return _success,header,desc #FIXME: 错误处理未做 报告到控制面板 except Exception as e: + header = _("Preparing the upgrade failed") + desc = _("groups JSON ConfigPkgs install failed") logging.warning("groups JSON ConfigPkgs(%s) install failed...",GROUPS_PKG_NAME) logging.error(e) _success = False + return _success,header,desc #FIXME: #3、 判断目录是JSON配置文件夹是否缺失 缺失后进行修复 卸载重新安装步骤 diff --git a/po/zh_CN.po b/po/zh_CN.po index 817dc6a..0f18e04 100644 --- a/po/zh_CN.po +++ b/po/zh_CN.po @@ -1771,7 +1771,7 @@ msgstr "您可能无法检查更新或下载新的更新。" #: ../UpdateManager/UpdateManager.py:1002 msgid "Could not initialize the package information" -msgstr "" +msgstr "无法初始化软件包信息" #: ../UpdateManager/UpdateManager.py:1003 msgid "" @@ -1781,6 +1781,9 @@ msgid "" "Please report this bug against the 'kylin-system-updater' package and include the " "following error message:\n" msgstr "" +"初始化包信息时遇到无法解决的问题。\n" +"\n" +"请汇报这个“kylin-system-updater”软件包的错误,并且将如下信息包含在报告中:\n" #: ../UpdateManager/UpdateManager.py:1032 msgid "" @@ -1837,7 +1840,7 @@ msgstr "新的 Ubuntu 发行版 %s 可用" #. we assert a clean cache #: ../UpdateManager/UpdateManager.py:1153 msgid "Software index is broken" -msgstr "" +msgstr "软件索引已经损坏" #: ../UpdateManager/UpdateManager.py:1154 msgid "" @@ -1845,6 +1848,8 @@ msgid "" "manager \"Synaptic\" or run \"sudo apt-get install -f\" in a terminal to fix " "this issue at first." msgstr "" +"无法安装或删除任何软件。请使用新立得软件包管理器或在终端运行 \"sudo apt-get " +"install -f\" 来修正这个问题。" #: ../UpdateManager/UnitySupport.py:57 msgid "Check for Updates" @@ -2568,3 +2573,6 @@ msgstr "检查升级包是否不存在本次升级" msgid "read important list failed" msgstr "读取推送升级列表失败" + +msgid "groups JSON ConfigPkgs install failed" +msgstr "分组配置包安装失败" From 6e109b2f14f57ed54fb1370df4c956c6b2dd0e97 Mon Sep 17 00:00:00 2001 From: luoxueyi Date: Tue, 26 Oct 2021 11:34:33 +0800 Subject: [PATCH 10/11] =?UTF-8?q?log=E5=8A=A0=E9=A2=9C=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SystemUpdater/UpdateManagerDbus.py | 39 +++++++++++++++++++++--------- kylin-system-updater | 1 + 2 files changed, 29 insertions(+), 11 deletions(-) diff --git a/SystemUpdater/UpdateManagerDbus.py b/SystemUpdater/UpdateManagerDbus.py index 34a1a92..ddf045a 100755 --- a/SystemUpdater/UpdateManagerDbus.py +++ b/SystemUpdater/UpdateManagerDbus.py @@ -18,6 +18,23 @@ UPDATER_DBUS_INTERFACE = 'com.kylin.systemupgrade.interface' UPDATER_DBUS_PATH = '/com/kylin/systemupgrade' UPDATER_DBUS_SERVICE = 'com.kylin.systemupgrade' +#颜色设置 +COLORLOG_SUFFIX = "\033[0m" + +NO_PRE = "\033[0m" +RED_PRE = "\033[31;1m" +GREEN_PRE = "\033[32;1m" +YELLOW_PRE = "\033[33;1m" +BULE_PRE = "\033[34;1m" +BACK_BLACK_PER = "\033[40;1m" +BACK_RED_PER = "\033[41;1m" +BACK_GREEN_PER = "\033[42;1m" +BACK_YELLOW_PER = "\033[43;1m" +BACK_BLUE_PER = "\033[44;1m" +BACK_WHITE_YELLOW_PRE = "\033[1;31;43m" + +COLORLOG_PREFIX = BACK_YELLOW_PER + #dbus 建立 class UpdateManagerDbusController(dbus.service.Object): """ this is a helper to provide the UpdateManagerIFace """ @@ -206,34 +223,34 @@ class UpdateManagerDbusController(dbus.service.Object): self.parent.start_download(pkgs) times -= 1 return True - + #更新进度信息 0~100 进度信息 101为非预期的信号 @dbus.service.signal(UPDATER_DBUS_INTERFACE,signature='is') def UpdateDetectStatusChanged(self,progress,status): - logging.info("emit UpdateDetectStatusChanged progress = %d , status = %s",progress,status) + logging.info(COLORLOG_PREFIX+"emit"+COLORLOG_SUFFIX+" UpdateDetectStatusChanged progress = %d , status = %s",progress,status) #更新完成的信号 @dbus.service.signal(UPDATER_DBUS_INTERFACE,signature='basss') def UpdateDetectFinished(self, success, upgrade_group,error_string='',error_desc='',): - logging.info("emit UpdateDetectFinished success = %r , upgrade_group = %a, error_string = %s , error_desc = %s ",\ + 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) #升级的进度信息 0~100 进度信息 101为非预期的信号 @dbus.service.signal(UPDATER_DBUS_INTERFACE,signature='asiss') def UpdateDloadAndInstStaChanged(self,groups_list,progress,status,current_details): - logging.info("emit UpdateDloadAndInstStaChanged upgrade groups_list = %s progress = %d , status = %s ,\ - current_details = %s",groups_list,progress,status,current_details) + logging.info(COLORLOG_PREFIX + "emit" + COLORLOG_SUFFIX +" UpdateDloadAndInstStaChanged upgrade groups_list = %s progress = %d , status = %s ,\ + current_details = %s\033[0m",groups_list,progress,status,current_details) #升级完成的信号 @dbus.service.signal(UPDATER_DBUS_INTERFACE,signature='basss') def UpdateDownloadFinished(self, success, upgrade_group,error_string='',error_desc='',): - logging.info("emit UpdateDownloadFinished success = %r , upgrade_group = %a, error_string = %s , error_desc = %s ",\ + logging.info(COLORLOG_PREFIX + "emit" + COLORLOG_SUFFIX +" UpdateDownloadFinished success = %r , upgrade_group = %a, error_string = %s , error_desc = %s ",\ success,upgrade_group, error_string,error_desc) #发送下载包信息 @dbus.service.signal(UPDATER_DBUS_INTERFACE, signature='iiiii') def UpdateDownloadInfo(self, current_items, total_items, currenty_bytes, total_bytes, current_cps): - logging.info("emit UpdateDownloadInfo current_items = %d, total_items = %d, currenty_bytes = %s, total_bytes = %s, current_cps = %s/s",\ + logging.info(COLORLOG_PREFIX + "emit" + COLORLOG_SUFFIX +" UpdateDownloadInfo 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)) @@ -241,23 +258,23 @@ 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='',): - logging.info("emit UpdateDependResloveStatus:resolver_status = %r , resolver_status = %r , remove_pkgs = %a,pkg_raw_description = %a ,delete_desc = %a,error_string = %s , error_desc = %s ",\ + logging.info(COLORLOG_PREFIX + "emit" + COLORLOG_SUFFIX +" UpdateDependResloveStatus:resolver_status = %r , resolver_status = %r , remove_pkgs = %a,pkg_raw_description = %a ,delete_desc = %a,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='',): - logging.info("emit DistupgradeDependResloveStatus:resolver_status = %r , resolver_status = %r , remove_pkgs = %a,pkg_raw_description = %a ,error_string = %s , error_desc = %s ",\ + 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) # 信号是否可取消 @dbus.service.signal(UPDATER_DBUS_INTERFACE, signature='b') def Cancelable(self, Cancelable): - logging.info("emit Cancelable: %r",\ + logging.info(COLORLOG_PREFIX + "emit" + COLORLOG_SUFFIX +" Cancelable: %r",\ Cancelable) # 插入数据库完成后发送 @dbus.service.signal(UPDATER_DBUS_INTERFACE, signature='ss') def update_sqlite_single(self, appname, date): - logging.info("emit update_sqlite_single: [ %s ]: date: %s .",\ + logging.info(COLORLOG_PREFIX + "emit" + COLORLOG_SUFFIX +" update_sqlite_single: [ %s ]: date: %s .",\ appname, date) diff --git a/kylin-system-updater b/kylin-system-updater index 602e47a..5af8c4a 100755 --- a/kylin-system-updater +++ b/kylin-system-updater @@ -59,6 +59,7 @@ if __name__ == "__main__": signal.signal(signal.SIGINT,signal_handler_term) logging.basicConfig(format=FORMAT,level=logging.DEBUG) + logging.info("luoxueyi"+"123") # if options.debug: # logging.basicConfig(format=FORMAT,level=logging.DEBUG) From 1851b926f10386a132dc3e12e4183930f309cfec Mon Sep 17 00:00:00 2001 From: wangsong Date: Tue, 26 Oct 2021 14:23:57 +0800 Subject: [PATCH 11/11] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SystemUpdater/UpdateManager.py | 6 +++--- SystemUpdater/backend/InstallBackendAptdaemon.py | 2 +- kylin-system-updater | 8 ++++---- po/zh_CN.po | 3 +++ 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/SystemUpdater/UpdateManager.py b/SystemUpdater/UpdateManager.py index a15c3c5..6c64e4e 100644 --- a/SystemUpdater/UpdateManager.py +++ b/SystemUpdater/UpdateManager.py @@ -100,7 +100,7 @@ class UpdateManager(): _success,header,desc = self.refresh_cache() #特殊情况的处理 单独安装包需要直接退出 安装or卸载执行完毕后 还会调到start_available - if _success == True and header == INSTALL_ALONE_PROGRESS: + if _success == False and header == INSTALL_ALONE_PROGRESS: return else: upgrade_list = self.update_list.local_upgrade_data.upgrade_groups + self.update_list.local_upgrade_data.single_pkgs @@ -129,7 +129,7 @@ class UpdateManager(): self.start_install(MODE_UPGRADE_SINGLE,True) #直接退出 - _success = True + _success = False header = INSTALL_ALONE_PROGRESS return _success,header,desc else: @@ -139,7 +139,7 @@ class UpdateManager(): pkg_json.mark_install() self.start_install(MODE_UPGRADE_SINGLE,True) #直接退出 - _success = True + _success = False header = INSTALL_ALONE_PROGRESS return _success,header,desc diff --git a/SystemUpdater/backend/InstallBackendAptdaemon.py b/SystemUpdater/backend/InstallBackendAptdaemon.py index cb634cc..63593bf 100644 --- a/SystemUpdater/backend/InstallBackendAptdaemon.py +++ b/SystemUpdater/backend/InstallBackendAptdaemon.py @@ -69,7 +69,7 @@ class InstallBackendAptdaemon(InstallBackend): authorized=True, success=False, #FIXME: 安装超时退出 error_string=_("Could not install the upgrades"), - error_desc=_("Installtion timeout to exit Due to inactivity")) + error_desc=_("Installtion timeout to exit Due to inactivity") + self.details) self.window_main.dbusController.Quit(None) return False diff --git a/kylin-system-updater b/kylin-system-updater index f3d90f7..5bda47c 100755 --- a/kylin-system-updater +++ b/kylin-system-updater @@ -48,6 +48,10 @@ if __name__ == "__main__": (options, args) = parser.parse_args() + if os.getuid() != 0: + print(_("You need to be root to run this application")) + sys.exit(1) + # set debconf to NON_INTERACTIVE os.environ["DEBIAN_FRONTEND"] = "noninteractive" os.environ["TERM"] = "xterm" @@ -62,10 +66,6 @@ if __name__ == "__main__": logging.basicConfig(format=FORMAT,level=logging.DEBUG) else: logging.basicConfig(format=FORMAT,level=logging.INFO,filename = logfile(),filemode = 'a') - - if os.getuid() != 0: - print(_("You need to be root to run this application")) - sys.exit(1) logging.info('kylin-system-updater starting ...') diff --git a/po/zh_CN.po b/po/zh_CN.po index 0f18e04..c2cee07 100644 --- a/po/zh_CN.po +++ b/po/zh_CN.po @@ -2576,3 +2576,6 @@ msgstr "读取推送升级列表失败" msgid "groups JSON ConfigPkgs install failed" msgstr "分组配置包安装失败" + +msgid "Installtion timeout to exit Due to inactivity" +msgstr "安装超时退出由于"