本文整理汇总了Python中Pkg.parse_deps方法的典型用法代码示例。如果您正苦于以下问题:Python Pkg.parse_deps方法的具体用法?Python Pkg.parse_deps怎么用?Python Pkg.parse_deps使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pkg
的用法示例。
在下文中一共展示了Pkg.parse_deps方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_parse_deps
# 需要导入模块: import Pkg [as 别名]
# 或者: from Pkg import parse_deps [as 别名]
def test_parse_deps(self):
for (arg, exp) in (
("a, b < 1.0 c = 5:2.0-3 d",
[("a", 0, (None, None, None)),
("b", rpm.RPMSENSE_LESS, (None, "1.0", None)),
("c", rpm.RPMSENSE_EQUAL, ("5", "2.0", "3")),
("d", 0, (None, None, None))]),
):
self.assertEqual(Pkg.parse_deps(arg), exp)
示例2: check_spec
# 需要导入模块: import Pkg [as 别名]
# 或者: from Pkg import parse_deps [as 别名]
#.........这里部分代码省略.........
res = buildarch_regex.search(line)
if res:
if res.group(1) != "noarch":
printError(pkg,
'buildarch-instead-of-exclusivearch-tag',
res.group(1))
else:
package_noarch[current_package] = True
res = packager_regex.search(line)
if res:
printWarning(pkg, 'hardcoded-packager-tag', res.group(1))
res = prefix_regex.search(line)
if res:
if not res.group(1).startswith('%'):
printWarning(pkg, 'hardcoded-prefix-tag', res.group(1))
res = prereq_regex.search(line)
if res:
printError(pkg, 'prereq-use', res.group(2))
res = buildprereq_regex.search(line)
if res:
printError(pkg, 'buildprereq-use', res.group(1))
if scriptlet_requires_regex.search(line):
printError(pkg, 'broken-syntax-in-scriptlet-requires',
line.strip())
res = requires_regex.search(line)
if res:
reqs = Pkg.parse_deps(res.group(1))
for req in unversioned(reqs):
if compop_regex.search(req):
printWarning(pkg,
'comparison-operator-in-deptoken',
req)
res = provides_regex.search(line)
if res:
provs = Pkg.parse_deps(res.group(1))
for prov in unversioned(provs):
printWarning(pkg, 'unversioned-explicit-provides',
prov)
if compop_regex.search(prov):
printWarning(pkg,
'comparison-operator-in-deptoken',
prov)
res = obsoletes_regex.search(line)
if res:
obses = Pkg.parse_deps(res.group(1))
for obs in unversioned(obses):
printWarning(pkg, 'unversioned-explicit-obsoletes',
obs)
if compop_regex.search(obs):
printWarning(pkg,
'comparison-operator-in-deptoken',
obs)
res = conflicts_regex.search(line)
if res:
confs = Pkg.parse_deps(res.group(1))
for conf in unversioned(confs):