What happened? What is the problem?
In case of pg_auto_failover.spec or xorgxrdp.spec begin of condition remains in main package section while %endif goes to sub-package. So you get IndexError when trying to parse it.
from specfile import Specfile
with Specfile("xorgxrdp.spec") as specfile:
with specfile.sections() as sections:
for section in sections:
if "package" in section.name:
with specfile.tags(section) as tags:
for tag in tags:
print(tag.name)
File "/usr/lib64/python3.9/site-packages/specfile/context_management.py", line 133, in __call__
self.values[key] = next(self.generators[key])
File "/usr/lib64/python3.9/site-packages/specfile/specfile.py", line 273, in tags
tags = Tags.parse(section, context=self)
File "/usr/lib64/python3.9/site-packages/specfile/tags.py", line 497, in parse
lines = process_conditions(list(section), macro_definitions, context)
File "/usr/lib64/python3.9/site-packages/specfile/conditions.py", line 119, in process_conditions
result.append((line, branches[-2]))
IndexError: list index out of range
What did you expect to happen?
No errors.
May be process conditions before splitting to sections?
Example URL(s)
No response
Steps to reproduce
1. get xorgxrdp.spec
2. try to get package glamor tags
3. IndexError: list index out of range
Workaround
Participation
What happened? What is the problem?
In case of pg_auto_failover.spec or xorgxrdp.spec begin of condition remains in main
packagesection while%endifgoes to sub-package. So you getIndexErrorwhen trying to parse it.What did you expect to happen?
No errors.
May be process conditions before splitting to sections?
Example URL(s)
No response
Steps to reproduce
Workaround
Participation