Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
avocado
提交
acc07362
A
avocado
项目概览
openeuler
/
avocado
通知
0
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
avocado
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
acc07362
编写于
2月 04, 2016
作者:
L
Lukáš Doktor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
avocado.utils.software_manager: Pylint fixes
Signed-off-by:
N
Lukáš Doktor
<
ldoktor@redhat.com
>
上级
85a4d1e4
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
15 addition
and
14 deletion
+15
-14
avocado/utils/software_manager.py
avocado/utils/software_manager.py
+15
-14
未找到文件。
avocado/utils/software_manager.py
浏览文件 @
acc07362
...
...
@@ -207,10 +207,7 @@ class RpmBackend(BaseBackend):
if
'not installed'
in
inst_version
:
return
False
if
inst_version
>=
version
:
return
True
else
:
return
False
return
bool
(
inst_version
>=
version
)
def
check_installed
(
self
,
name
,
version
=
None
,
arch
=
None
):
"""
...
...
@@ -367,7 +364,7 @@ class YumBackend(RpmBackend):
verbose
=
False
,
shell
=
True
)
out
=
cmd_result
.
stdout
.
strip
()
try
:
ver
=
re
.
findall
(
'\d*.\d*.\d*'
,
out
)[
0
]
ver
=
re
.
findall
(
r
'\d*.\d*.\d*'
,
out
)[
0
]
except
IndexError
:
ver
=
out
self
.
pm_version
=
ver
...
...
@@ -504,9 +501,9 @@ class YumBackend(RpmBackend):
return
None
try
:
d_provides
=
self
.
yum_base
.
searchPackageProvides
(
args
=
[
name
])
except
Exception
,
e
:
except
Exception
,
e
xc
:
log
.
error
(
"Error searching for package that "
"provides %s: %s"
,
name
,
e
)
"provides %s: %s"
,
name
,
e
xc
)
d_provides
=
[]
provides_list
=
[
key
for
key
in
d_provides
]
...
...
@@ -674,19 +671,20 @@ class AptBackend(DpkgBackend):
executable
=
utils_path
.
find_command
(
'apt-get'
)
self
.
base_command
=
executable
+
' --yes --allow-unauthenticated'
self
.
repo_file_path
=
'/etc/apt/sources.list.d/avocado.list'
self
.
dpkg_force_confdef
=
'-o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold"'
self
.
dpkg_force_confdef
=
(
'-o Dpkg::Options::="--force-confdef" '
'-o Dpkg::Options::="--force-confold"'
)
cmd_result
=
process
.
run
(
'apt-get -v | head -1'
,
ignore_status
=
True
,
verbose
=
False
,
shell
=
True
)
out
=
cmd_result
.
stdout
.
strip
()
try
:
ver
=
re
.
findall
(
'\d\S*'
,
out
)[
0
]
ver
=
re
.
findall
(
r
'\d\S*'
,
out
)[
0
]
except
IndexError
:
ver
=
out
self
.
pm_version
=
ver
log
.
debug
(
'apt-get version: %s'
%
self
.
pm_version
)
log
.
debug
(
'apt-get version: %s'
,
self
.
pm_version
)
# gdebi-core is necessary for local installation with dependency
# handling
if
not
self
.
check_installed
(
'gdebi-core'
):
...
...
@@ -706,7 +704,8 @@ class AptBackend(DpkgBackend):
i_cmd
=
utils_path
.
find_command
(
'gdebi'
)
+
' -n -q '
+
name
else
:
command
=
'install'
i_cmd
=
" "
.
join
([
self
.
base_command
,
self
.
dpkg_force_confdef
,
command
,
name
])
i_cmd
=
" "
.
join
([
self
.
base_command
,
self
.
dpkg_force_confdef
,
command
,
name
])
try
:
process
.
system
(
i_cmd
,
shell
=
True
,
sudo
=
True
)
...
...
@@ -758,7 +757,7 @@ class AptBackend(DpkgBackend):
new_file_contents
=
[]
with
open
(
self
.
repo_file_path
,
'r'
)
as
repo_file
:
for
line
in
repo_file
.
readlines
():
if
not
line
=
=
repo
:
if
line
!
=
repo
:
new_file_contents
.
append
(
line
)
new_file_contents
=
"
\n
"
.
join
(
new_file_contents
)
prefix
=
"avocado_software_manager"
...
...
@@ -790,10 +789,12 @@ class AptBackend(DpkgBackend):
if
name
:
up_command
=
'install --only-upgrade'
up_cmd
=
" "
.
join
([
self
.
base_command
,
self
.
dpkg_force_confdef
,
up_command
,
name
])
up_cmd
=
" "
.
join
([
self
.
base_command
,
self
.
dpkg_force_confdef
,
up_command
,
name
])
else
:
up_command
=
'upgrade'
up_cmd
=
" "
.
join
([
self
.
base_command
,
self
.
dpkg_force_confdef
,
up_command
])
up_cmd
=
" "
.
join
([
self
.
base_command
,
self
.
dpkg_force_confdef
,
up_command
])
try
:
process
.
system
(
up_cmd
,
shell
=
True
,
sudo
=
True
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录