mirror of
https://github.com/clearlinux/autospec.git
synced 2026-08-27 10:56:03 +00:00
Update dependencies in specfile from infile
The specfile dependencies are a set, so create a set from the deps scraped from the bb file, union the two sets, and write it to the specfile. Signed-off-by: Gabi Beyer <gabib@live.com>
This commit is contained in:
committed by
Matthew Johnson
parent
0a1def5f0b
commit
bc7f5a8b51
@@ -202,11 +202,26 @@ def update_summary(bb_dict, specfile):
|
||||
break
|
||||
|
||||
|
||||
def update_build_deps(bb_dict, specfile):
|
||||
deps = set()
|
||||
for dep in bb_dict.get('DEPENDS').split():
|
||||
dep = re.match(r"(\$\{PYTHON_PN\}\-)?([a-zA-Z0-9\-]+)", dep).group(2)
|
||||
if dep.endswith('-native'):
|
||||
dep = dep[:-7]
|
||||
deps.add(dep)
|
||||
|
||||
spec_deps = getattr(specfile, 'buildreqs')
|
||||
setattr(specfile, 'buildreqs', spec_deps.union(deps))
|
||||
|
||||
|
||||
def update_specfile(specfile, bb_dict):
|
||||
|
||||
# update the package summary if one does not exist
|
||||
update_summary(bb_dict, specfile)
|
||||
|
||||
# union the current set of buildreqs in the specfile to the bb ones
|
||||
update_build_deps(bb_dict, specfile)
|
||||
|
||||
|
||||
def parse_bb(bb, specfile):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user