Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to parse NetworkManager.spec #403

Closed
1 of 2 tasks
bilelmoussaoui opened this issue Jul 26, 2024 · 4 comments · Fixed by #405
Closed
1 of 2 tasks

Fails to parse NetworkManager.spec #403

bilelmoussaoui opened this issue Jul 26, 2024 · 4 comments · Fixed by #405

Comments

@bilelmoussaoui
Copy link

bilelmoussaoui commented Jul 26, 2024

What happened? What is the problem?

Trying to create an instance of Specfile of NetworkManager.spec fails with the following

    with spec_file.sources() as sources:
         ^^^^^^^^^^^^^^^^^^^
  File "/some-path/.venv/lib/python3.12/site-packages/specfile/context_management.py", line 133, in __call__
    self.values[key] = next(self.generators[key])
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/some-path/.venv/lib/python3.12/site-packages/specfile/specfile.py", line 365, in sources
    with self.sections() as sections, self.tags() as tags:
                                      ^^^^^^^^^^^
  File /some-path//.venv/lib/python3.12/site-packages/specfile/context_management.py", line 133, in __call__
    self.values[key] = next(self.generators[key])
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/some-path/.venv/lib/python3.12/site-packages/specfile/specfile.py", line 292, in tags
    tags = Tags.parse(section, context=self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/some-path/.venv/lib/python3.12/site-packages/specfile/tags.py", line 497, in parse
    lines = process_conditions(list(section), macro_definitions, context)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/some-path/.venv/lib/python3.12/site-packages/specfile/conditions.py", line 133, in process_conditions
    result.append((line, branches[-2]))
                         ~~~~~~~~^^^^

What did you expect to happen?

The parsing to pass

Example URL(s)

No response

Steps to reproduce

1.
2.
3.

Workaround

  • There is an existing workaround that can be used until this issue is fixed.

Participation

  • I am willing to submit a pull request for this issue. (Packit team is happy to help!)
@lachmanfrantisek
Copy link
Member

Hi @bilelmoussaoui !

Just to be sure, we are speaking about this specfile, right?
https://src.fedoraproject.org/rpms/NetworkManager/blob/rawhide/f/NetworkManager.spec

I guess you use a fresh version of specfile.

@nforro do you have any quick ideas what could go wrong here?

@bilelmoussaoui
Copy link
Author

bilelmoussaoui commented Jul 29, 2024

I am using the spec file from NetworkManager-1.48.2-2.el9 as I am trying to make use of it for some internal experiment.

@nforro
Copy link
Member

nforro commented Jul 29, 2024

@nforro do you have any quick ideas what could go wrong here?

Yes, I've already fixed it but discovered another bug during that, so it will take a bit more time 🙂

@bilelmoussaoui
Copy link
Author

Thanks a lot @nforro

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants