diff --git a/backend/SystemUpdater/Core/Database.py b/backend/SystemUpdater/Core/Database.py index e98deae..6792fc8 100644 --- a/backend/SystemUpdater/Core/Database.py +++ b/backend/SystemUpdater/Core/Database.py @@ -141,7 +141,7 @@ class Sqlite3Server(object): logging.info(_("Data insertion complete .")) # 接收更新列表与信息,生成数据并插入数据库中 - def insert_info(self, mode, pkg_list=[], pkg_group=[], success = False, error_string = '', error_desc = ''): + def insert_info(self, mode, pkg_list=[], pkg_group=[], adjust_pkg=[], success = False, error_string = '', error_desc = ''): errstr = error_string + " " + error_desc status = " " time = datetime.datetime.now() @@ -167,13 +167,23 @@ class Sqlite3Server(object): elif pkg_list: # 单包更新 # 获取单包数据插入数据库 pkgname = pkg_list[0] + for adj in adjust_pkg: + if pkgname in adj: + # 该部分升级的单包为调整版本,与候选版本不一致 + pkgname = adj + break try: - pkg = self.window_main.cache[pkgname] + pkg = self.window_main.cache[pkgname.split("=")[0]] + for ver in pkg.versions: + if ver.version == pkgname.split("=")[1]: + pkg_inst_ver = ver + break + pkgname = pkgname.split("=")[0] except Exception as e: logging.error(_("%s could not be detected in the source because the source was changed or for other reasons."), \ str(pkgname)) - pkgversion = str(pkg.candidate.version) - pkgdescription = str(pkg.candidate.raw_description) + pkgversion = str(pkg_inst_ver.source_version) + pkgdescription = str(pkg_inst_ver.description) try: self.insert_into_updateinfo(pkgname, pkgversion, pkgdescription, timestr, status, "1", errstr) # FIXME: 发送插入数据库成功的信号local_upgrade_list diff --git a/backend/SystemUpdater/backend/__init__.py b/backend/SystemUpdater/backend/__init__.py index baa6c98..b7fb65c 100644 --- a/backend/SystemUpdater/backend/__init__.py +++ b/backend/SystemUpdater/backend/__init__.py @@ -447,6 +447,7 @@ class InstallBackend(): self.now_upgrade.upgrade_mode, self.now_upgrade.single_pkgs, self.now_upgrade.upgrade_groups, + self.upgrade_data.adjust_pkgs, success, error_string, error_desc) if success: diff --git a/backend/interface.md b/backend/interface.md index e7f20b7..d11de33 100755 --- a/backend/interface.md +++ b/backend/interface.md @@ -96,8 +96,18 @@ ACTION_REMOVE_PACKAGES = 6 #卸载包的状态中 ``` - +#### UnattendedUpgradeValue +- `介绍:` 设置或获取是否允许关机前更新 + +- `入参`: `s:`operation("get"/"set"),`s:`value将要设置的值 + +- `示例:` + + ```sh + operation = "set", value = "false" + + ``` #### Signal列表