Merge branch 'backend_dev' of gitlab2.kylin.com:kylin-desktop/update-manager-group/kylin-system-updater into backend_dev

This commit is contained in:
wangsong 2021-11-16 17:19:02 +08:00
commit b9afec468a
6 changed files with 53 additions and 10 deletions

View File

@ -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()
@ -159,6 +159,7 @@ class Sqlite3Server(object):
# 判断更新方式
if mode == MODE_UPGRADE_PARTIAL: # 部分更新
pkg_adj = ""
# 判断更新包为单包或更新组
if pkg_group:
# 更新组
@ -167,13 +168,33 @@ class Sqlite3Server(object):
elif pkg_list:
# 单包更新 # 获取单包数据插入数据库
pkgname = pkg_list[0]
try:
pkg = self.window_main.cache[pkgname]
except Exception as e:
logging.error(_("%s could not be detected in the source because the source was changed or for other reasons."), \
for adj in adjust_pkg:
if pkgname in adj:
# 该部分升级的单包为调整版本,与候选版本不一致
pkg_adj = adj
break
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.candidate.version)
pkgdescription = str(pkg.candidate.raw_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

@ -455,6 +455,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:

View File

@ -100,8 +100,18 @@
ACTION_REMOVE_PACKAGES = 6 #卸载包的状态中
```
#### UnattendedUpgradeValue
- `介绍:` 设置或获取是否允许关机前更新
- `入参`: `s:`operation("get"/"set")`s:`value将要设置的值
- `示例:`
```sh
operation = "set", value = "false"
```
#### Signal列表

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:

View File

@ -8,5 +8,6 @@ backend/SystemUpdater/*.py /usr/share/kylin-system-updater/SystemUpdater/
backend/SystemUpdater/backend/*.py /usr/share/kylin-system-updater/SystemUpdater/backend/
backend/SystemUpdater/Core/*.py /usr/share/kylin-system-updater/SystemUpdater/Core/
backend/build/mo/* /usr/share/locale/
backend/data/system-updater.conf /var/lib/kylin-system-updater/
plugin/translations/* /usr/share/Upgrade/translations/
plugin/libupgrade.so /usr/lib/