Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
openEuler-Advisor
提交
b8d5dfac
O
openEuler-Advisor
项目概览
openeuler
/
openEuler-Advisor
通知
40
Star
4
Fork
4
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
openEuler-Advisor
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
b8d5dfac
编写于
9月 10, 2020
作者:
O
openeuler-ci-bot
提交者:
Gitee
9月 10, 2020
浏览文件
操作
浏览文件
下载
差异文件
!139 数据初始化时增加对二进制的sqlite文件中的files表中的数据导入进包管理的bin_files表中
Merge pull request !139 from gongzhengtang/master
上级
0badc26d
20aba66e
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
26 addition
and
1 deletion
+26
-1
packageship/packageship/application/initsystem/data_import.py
...ageship/packageship/application/initsystem/data_import.py
+15
-1
packageship/packageship/application/models/package.py
packageship/packageship/application/models/package.py
+11
-0
未找到文件。
packageship/packageship/application/initsystem/data_import.py
浏览文件 @
b8d5dfac
...
...
@@ -20,6 +20,7 @@ from packageship.application.models.package import BinPack
from
packageship.application.models.package
import
BinRequires
from
packageship.application.models.package
import
SrcRequires
from
packageship.application.models.package
import
BinProvides
from
packageship.application.models.package
import
BinFiles
from
packageship.application.models.package
import
Packages
from
packageship
import
system_config
...
...
@@ -60,7 +61,7 @@ class InitDataBase():
}
self
.
database_name
=
None
self
.
_tables
=
[
'src_pack'
,
'bin_pack'
,
'bin_requires'
,
'src_requires'
,
'bin_provides'
]
'bin_requires'
,
'src_requires'
,
'bin_provides'
,
'bin_files'
]
# Create life cycle related databases and tables
if
not
self
.
create_database
(
db_name
=
'lifecycle'
,
tables
=
[
'packages_issue'
,
...
...
@@ -299,6 +300,7 @@ class InitDataBase():
self
.
_save_bin_packages
(
db_name
)
self
.
_save_bin_requires
(
db_name
)
self
.
_save_bin_provides
(
db_name
)
self
.
_save_bin_files
(
db_name
)
except
(
SQLAlchemyError
,
ContentNoneException
)
as
sql_error
:
LOGGER
.
logger
.
error
(
sql_error
)
self
.
__del_database
(
db_name
)
...
...
@@ -455,6 +457,18 @@ class InitDataBase():
with
DBHelper
(
db_name
=
db_name
)
as
database
:
database
.
batch_add
(
provides_datas
,
BinProvides
)
def
_save_bin_files
(
self
,
db_name
):
self
.
sql
=
" select * from files "
files_datas
=
self
.
__get_data
()
if
files_datas
is
None
:
raise
ContentNoneException
(
'{db_name}:There is no relevant binary file installation
\
path data in the provided database '
.
format
(
db_name
=
db_name
))
with
DBHelper
(
db_name
=
db_name
)
as
database
:
database
.
batch_add
(
files_datas
,
BinFiles
)
def
__exists_repeat_database
(
self
):
"""
Determine if the same database name exists
...
...
packageship/packageship/application/models/package.py
浏览文件 @
b8d5dfac
...
...
@@ -127,6 +127,17 @@ class BinProvides(DBHelper.BASE):
pkgKey
=
Column
(
Integer
,
nullable
=
True
)
class
BinFiles
(
DBHelper
.
BASE
):
"""
Installation path of the binary package
"""
__tablename__
=
'bin_files'
id
=
Column
(
Integer
,
primary_key
=
True
)
name
=
Column
(
String
(
500
),
nullable
=
True
)
type
=
Column
(
String
(
50
),
nullable
=
True
)
pkgKey
=
Column
(
Integer
)
class
Packages
():
"""
Source code package version, issuer and other information
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录