Merge branch 'backend_manual' of gitlab2.kylin.com:kylin-desktop/update-manager-group/kylin-system-updater into backend_manual
This commit is contained in:
commit
6c1ac75654
|
@ -203,9 +203,11 @@ class Sqlite3Server(object):
|
|||
json_file = json.dumps(InstallInfos.copy())
|
||||
self.window_main.collector.UpdateMsg("InstallInfos", json_file)
|
||||
# 系统升级完成 ..判断版本号
|
||||
if status == "success" and "kylin-update-desktop-system" in pkg_group:
|
||||
if status == "success" and "kylin-update-desktop-system" in pkgname:
|
||||
# 更新版本号
|
||||
self._refresh_system_version()
|
||||
if "=" in str(pkgversion):
|
||||
version = str(pkgversion).split('=')[-1]
|
||||
self._refresh_system_version(version)
|
||||
elif pkg_list:
|
||||
# 单包更新 # 获取单包数据插入数据库
|
||||
pkgname = pkg_list.pop(0)
|
||||
|
@ -344,7 +346,7 @@ class Sqlite3Server(object):
|
|||
# 系统升级完成 ..判断版本号
|
||||
if status == "success" and "kylin-update-desktop-system" in pkg_group:
|
||||
# 更新版本号
|
||||
self._refresh_system_version()
|
||||
self._refresh_system_version(str(pkgversion))
|
||||
|
||||
elif mode == InstallBackend.MODE_INSTALL_SYSTEM: # 全盘升级
|
||||
self.insert_into_updateinfo(str("Upgrade System"), "", "This is a complete system upgrade, equivalent to the implementation of apt dist-upgrade", timestr, status, "1", errstr)
|
||||
|
@ -429,13 +431,11 @@ class Sqlite3Server(object):
|
|||
except Exception as e:
|
||||
logging.error(str(e))
|
||||
|
||||
def _refresh_system_version(self):
|
||||
def _refresh_system_version(self, version=''):
|
||||
try:
|
||||
#初始化系统版本号:version
|
||||
version_path = "/etc/kylin-version/kylin-system-version.conf"
|
||||
if os.path.isfile(version_path):
|
||||
version = UpgradeConfig(datadir = "/etc/kylin-version/", name = "kylin-system-version.conf").getWithDefault("SYSTEM", "version", " ")
|
||||
self.ucconfigs.setValue("SYSTEM","version",str(version),True)
|
||||
#刷新系统版本号:version
|
||||
version = version.strip()
|
||||
self.ucconfigs.setValue("SYSTEM","version",str(version),True)
|
||||
version = ""
|
||||
#初始化系统版本号:kylin_release_id
|
||||
version_path = "/etc/os-release"
|
||||
|
@ -445,7 +445,8 @@ class Sqlite3Server(object):
|
|||
for line in lines:
|
||||
if "KYLIN_RELEASE_ID" in line:
|
||||
version = line.split('=')[1]
|
||||
self.ucconfigs.setValue("SYSTEM","kylin_release_id",str(version),True)
|
||||
if len(version) != 0:
|
||||
self.ucconfigs.setValue("SYSTEM","kylin_release_id",str(version),True)
|
||||
except Exception as e:
|
||||
logging.error(str(e))
|
||||
|
||||
|
|
Loading…
Reference in New Issue