Skip to content

Commit

Permalink
Merge pull request openSUSE#2953 from Vogtinator/booleanfiles
Browse files Browse the repository at this point in the history
repo2fileprovides.py: Support file deps in boolean dependencies
  • Loading branch information
Vogtinator authored Apr 11, 2023
2 parents f596472 + f38a438 commit 8639ce3
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions repo2fileprovides.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,15 @@
requiredfiles = set(repodata.xpath("/md:metadata/md:package/md:format/rpm:requires/rpm:entry[starts-with(@name, '/')]/@name",
namespaces=NS))

# Split up boolean deps
booleandeps = set(repodata.xpath("/md:metadata/md:package/md:format/rpm:requires/rpm:entry"
"[starts-with(@name, '(') and contains(@name, '/')]/@name",
namespaces=NS))
for dep in booleandeps:
for capability in dep.replace('(', ' ').replace(')', ' ').split():
if capability[0] == '/':
requiredfiles.add(capability)

# Step 3: For all provided files which are also required, print "FileProvides"
# lines
for filename in sorted(providedfiles.intersection(requiredfiles)):
Expand Down

0 comments on commit 8639ce3

Please sign in to comment.