mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-15 03:53:32 +01:00
projects.py, pkg_relations(): Fix --no-subpackages, support multiple flavours
- --no-subpackages sometimes doesn\'t strip off -devel -run - Flavours can now be comma-separated Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
0b80649f59
commit
d8115e6b22
1 changed files with 35 additions and 32 deletions
|
|
@ -484,39 +484,42 @@ def pkg_relations(rel_type, args_):
|
|||
subsecs = args.subsections.split(',')
|
||||
debug('flavour = ', args.flavour, ', subsecs = ', ' '.join(subsecs))
|
||||
r = []
|
||||
for s in subsecs:
|
||||
for m in args.module:
|
||||
value = get_value(m, 'pkg.' + rel_type + '.' + s, args.flavour)
|
||||
if not value:
|
||||
continue
|
||||
deps = value.split(',')
|
||||
for spec in deps:
|
||||
dep = re.split('([=><]+)', spec)
|
||||
if args.no_version:
|
||||
dep = dep[:1]
|
||||
if args.no_subpackages:
|
||||
dep[0] = re.sub('-devel$|-run$', '', dep[0])
|
||||
for i, item in enumerate(dep):
|
||||
dep[i] = item.strip()
|
||||
if len(dep) == 3:
|
||||
dep_project = re.sub(r'-devel$|-run$', '', dep[0])
|
||||
if args.dont_expand_version_macros and dep_project in args.module:
|
||||
version = dep[2]
|
||||
else:
|
||||
version = get_value(dep_project, 'version', '')
|
||||
if dep[2] == 'VERSION':
|
||||
if args.dont_strip_revision:
|
||||
dep[2] = version
|
||||
flavours = args.flavour.split(',')
|
||||
for flavour in flavours:
|
||||
for s in subsecs:
|
||||
for m in args.module:
|
||||
value = get_value(m, 'pkg.' + rel_type + '.' + s, flavour)
|
||||
if not value:
|
||||
continue
|
||||
deps = value.split(',')
|
||||
for spec in deps:
|
||||
dep = re.split('([=><]+)', spec)
|
||||
if args.no_version:
|
||||
dep = dep[:1]
|
||||
dep = map(str.strip, dep)
|
||||
if args.no_subpackages:
|
||||
dep[0] = re.sub('-devel$|-run$', '', dep[0])
|
||||
for i, item in enumerate(dep):
|
||||
dep[i] = item.strip()
|
||||
if len(dep) == 3:
|
||||
dep_project = re.sub(r'-devel$|-run$', '', dep[0])
|
||||
if args.dont_expand_version_macros and dep_project in args.module:
|
||||
version = dep[2]
|
||||
else:
|
||||
dep[2] = version.split('-')[0]
|
||||
elif dep[2] == 'VERSION-REVISION':
|
||||
dep[2] = version
|
||||
elif version_pattern.match(dep[2]):
|
||||
# dep[2] = dep[2]
|
||||
pass
|
||||
else:
|
||||
raise Exception("Unknown version specifier in " + spec)
|
||||
r.append(' '.join(dep))
|
||||
version = get_value(dep_project, 'version', '')
|
||||
if dep[2] == 'VERSION':
|
||||
if args.dont_strip_revision:
|
||||
dep[2] = version
|
||||
else:
|
||||
dep[2] = version.split('-')[0]
|
||||
elif dep[2] == 'VERSION-REVISION':
|
||||
dep[2] = version
|
||||
elif version_pattern.match(dep[2]):
|
||||
# dep[2] = dep[2]
|
||||
pass
|
||||
else:
|
||||
raise Exception("Unknown version specifier in " + spec)
|
||||
r.append(' '.join(dep))
|
||||
print(args.delimiter.join(r))
|
||||
|
||||
def get_libname(names):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue