Merge branch 'backend_dev' into 'dev'

Backend dev

See merge request kylin-desktop/update-manager-group/kylin-system-updater!58
This commit is contained in:
wangsong 2021-11-16 09:23:09 +00:00
commit 5ddd510b8d
4 changed files with 51 additions and 26 deletions

View File

@ -159,6 +159,7 @@ class Sqlite3Server(object):
# 判断更新方式
if mode == MODE_UPGRADE_PARTIAL: # 部分更新
pkg_adj = ""
# 判断更新包为单包或更新组
if pkg_group:
# 更新组
@ -170,20 +171,30 @@ class Sqlite3Server(object):
for adj in adjust_pkg:
if pkgname in adj:
# 该部分升级的单包为调整版本,与候选版本不一致
pkgname = adj
pkg_adj = adj
break
try:
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."), \
if pkg_adj: # 有调整的情况
try:
pkg = self.window_main.cache[pkg_adj.split("=")[0]]
for ver in pkg.versions:
if ver.version == pkg_adj.split("=")[1]:
pkg_inst_ver = ver
break
pkgname = pkg_adj.split("=")[0]
pkgversion = str(pkg_inst_ver.source_version)
pkgdescription = str(pkg_inst_ver.description)
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_inst_ver.source_version)
pkgdescription = str(pkg_inst_ver.description)
logging.error(str(e))
else: # 没有调整的情况
try:
pkg = self.window_main.cache[pkgname]
pkgversion = str(pkg.candidate.version)
pkgdescription = str(pkg.candidate.raw_description)
except Exception as e:
logging.error(str(e))
try:
self.insert_into_updateinfo(pkgname, pkgversion, pkgdescription, timestr, status, "1", errstr)
# FIXME: 发送插入数据库成功的信号local_upgrade_list

View File

@ -142,9 +142,9 @@ class UpdateListFilterCache(apt.Cache):
else: # 判断升级列表
for nv in new_ver:
if nv > pkg.installed and nv != pkg.candidate:
logging.info("adjusting candidate version: %s" % new_ver)
logging.info("adjusting candidate version: %s" % nv)
if _is_adjust == True:
pkg.candidate = new_ver
pkg.candidate = nv
adjust_candidate_pkgs.append(pkg.name+"="+pkg.candidate.version)
break
elif nv > pkg.installed and nv == pkg.candidate:

View File

@ -21,18 +21,22 @@
### 方法列表
| Method Name | Input Args | Output Args | means |
| ------------------ | ---------- | ----------- | --------------------------------- |
| UpdateDetect | 无 | b | 更新cache产生组升级列表JSON文件 |
| DistUpgradeAll | b | b | 全部升级 |
| DistUpgradePartial | b,as | b | 部分升级 |
| DistUpgradeSystem | b | b | 全盘升级 |
| CancelDownload | 无 | b | 取消升级 |
| InsertInstallState | ss | b | 向display表插入数据 |
| GtDownloadspeedLimitValue | 无 | b | 获取当前限速 |
| SetDownloadspeedMax | sb | b | 设置限速 |
| GetBackendStatus | 无 | i | 控制获取后端状态 |
| UnattendedUpgradeValue | ss | bs | 获取是否允许关机前更新 |
| Method Name | Input Args | Output Args | means | 异步任务 |
| ------------------ | ---------- | ----------- | --------------------------------- | ------------------ |
| UpdateDetect | 无 | b | 更新cache产生组升级列表JSON文件 | |
| DistUpgradeAll | b | b | 全部升级 | |
| DistUpgradePartial | b,as | b | 部分升级 | |
| DistUpgradeSystem | b | b | 全盘升级 | |
| CancelDownload | 无 | b | 取消升级 | |
| InsertInstallState | ss | b | 向display表插入数据 | |
| GtDownloadspeedLimitValue | 无 | b | 获取当前限速 | |
| SetDownloadspeedMax | sb | b | 设置限速 | |
| GetBackendStatus | 无 | i | 控制获取后端状态 | |
| UnattendedUpgradeValue | ss | bs | 获取是否允许关机前更新 | |
| PurgePackages | as | bs | 卸载软件包 | 支持 |
| | | | | |
| | | | | |
| | | | | |
#### Method分析
#### UpdateDetect

10
debian/changelog vendored
View File

@ -1,3 +1,13 @@
kylin-system-updater (1.2.7.3kord) v101; urgency=medium
* BUG: bug#91191
* 需求号: 9002
* 需求:1.升级依赖修复机制减小第三方软件对系统更新的影响2.更新源锁定功能,屏蔽第三方软件源对系统更新的影响
* 其他改动说明:system-updater.conf文件配置;fix升级版本号记录不正确;
* 影响域: 系统升级
-- luoxueyi <luoxueyi@kylinos.cn> Tue, 16 Nov 2021 14:53:24 +0800
kylin-system-updater (1.2.7.2kord) v101; urgency=medium
* BUG: