8000 Too many names error for parsing · Issue #475 · packit/specfile · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Too many names error for parsing #475
Closed
@fmarco76

Description

@fmarco76

What happened? What is the problem?

Building Dogtag PKI package with packit provide the folloing error:

2025-05-16 15:17:53.588 logging.py        DEBUG  v11.6.0-301-gef79d8fa0c
2025-05-16 15:17:53.690 utils.py          ERROR  Preparation of the repository for creation of an SRPM failed: line 1648: Too many names: %files -n dogtag-pki -f\\ .mfiles
Traceback (most recent call last):
  File "/usr/lib/python3.13/site-packages/specfile/spec_parser.py", line 233, in get_rpm_spec
    return rpm.spec(tmp.name, flags)
           ~~~~~~~~^^^^^^^^^^^^^^^^^
ValueError: can't parse specfile


The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/lib/python3.13/site-packages/packit/api.py", line 1979, in prepare_sources
    self.up.prepare_upstream_for_srpm_creation(
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        upstream_ref=upstream_ref,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<4 lines>...
        env=self.common_env(),
        ^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/lib/python3.13/site-packages/packit/upstream.py", line 1052, in prepare_upstream_for_srpm_creation
    SRPMBuilder(upstream=self, ref=upstream_ref).prepare(
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        update_release=update_release,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<2 lines>...
        env=env,
        ^^^^^^^^
    )
    ^
  File "/usr/lib/python3.13/site-packages/packit/upstream.py", line 1552, in prepare
    self._fix_specfile_to_use_local_archive(
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        archive=created_archive,
        ^^^^^^^^^^^^^^^^^^^^^^^^
        update_release=update_release,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        release_suffix=release_suffix,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/lib/python3.13/site-packages/packit/upstream.py", line 1522, in _fix_specfile_to_use_local_archive
    new_release = self.upstream.get_spec_release(release_suffix)
  File "/usr/lib/python3.13/site-packages/packit/upstream.py", line 889, in get_spec_release
    original_release_number = self.specfile.expanded_release.split(".", 1)[0]
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/site-packages/specfile/specfile.py", line 768, in expanded_release
    return self.expand(self.release, extra_macros=[("dist", "")])
           ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/site-packages/specfile/specfile.py", line 307, in expand
    self._parser.parse(str(self), extra_macros)
    ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/site-packages/specfile/spec_parser.py", line 387, in parse
    self.spec, self.tainted = self._do_parse(content, extra_macros)
                              ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/site-packages/specfile/spec_parser.py", line 301, in _do_parse
    spec = get_rpm_spec(content, rpm.RPMSPEC_ANYARCH | rpm.RPMSPEC_FORCE)
  File "/usr/lib/python3.13/site-packages/specfile/spec_parser.py", line 235, in get_rpm_spec
    raise RPMException(stderr=stderr) from e
specfile.exceptions.RPMException: line 1648: Too many names: %files -n dogtag-pki -f\\ .mfiles

The above
7F30
 exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/lib/python3.13/site-packages/packit/cli/utils.py", line 47, in covered_func
    func(config=config, *args, **kwargs)  # noqa: B026
    ~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/site-packages/packit/cli/utils.py", line 143, in covered_func
    func(*args, **decorated_func_kwargs)
    ~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/site-packages/packit/cli/prepare_sources.py", line 193, in prepare_sources
    api.prepare_sources(
    ~~~~~~~~~~~~~~~~~~~^
        upstream_ref=upstream_ref,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<4 lines>...
        create_symlinks=create_symlinks,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/lib/python3.13/site-packages/packit/api.py", line 1988, in prepare_sources
    raise PackitSRPMException(
        f"Preparation of the repository for creation of an SRPM failed: {ex}",
    ) from ex
packit.exceptions.PackitSRPMException: Preparation of the repository for creation of an SRPM failed: line 1648: Too many names: %files -n dogtag-pki -f\\ .mfiles
2025-05-16 15:17:53.694 local_project.py  DEBUG  Cleaning: /tmp/tmp938844s_

What did you expect to happen?

It should properly generate the source package because the spec file is valid and works properly.

Example URL(s)

The error can be seen in all Packit build of DogtagPKI.

Steps to reproduce

Approach 1:
1. Try to reproduce packit build from the above

Approach 2 (it produce the same errror):
1. Getting the pki project from the repository https://github.com/dogtagpki/pki
2. open python interpreter
3. Run the following commands:

>>> from  specfile import Specfile
>>> spec = Specfile(path="/home/mfargetta/Projects/upstream/pki/pki.spec")
>>> print(spec.expanded_version)
11.7.0
>>> print(spec.expanded_name)
pki
>>> print(spec.expanded_version)
Traceback (most recent call last):
  File "/usr/lib/python3.13/site-packages/specfile/spec_parser.py", line 233, in get_rpm_spec
    return rpm.spec(tmp.name, flags)
           ~~~~~~~~^^^^^^^^^^^^^^^^^
ValueError: can't parse specfile


The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "<python-input-4>", line 1, in <module>
    print(spec.expanded_version)
          ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/site-packages/specfile/specfile.py", line 692, in getter
    return getattr(tags, name).expanded_value
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/site-packages/specfile/tags.py", line 287, in expanded_value
    return self._context.expand(self.value)
           ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
  File "/usr/lib/python3.13/site-packages/specfile/specfile.py", line 307, in expand
    self._parser.parse(str(self), extra_macros)
    ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/site-packages/specfile/spec_parser.py", line 387, in parse
    self.spec, self.tainted = self._do_parse(content, extra_macros)
                              ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/site-packages/specfile/spec_parser.py", line 301, in _do_parse
    spec = get_rpm_spec(content, rpm.RPMSPEC_ANYARCH | rpm.RPMSPEC_FORCE)
  File "/usr/lib/python3.13/site-packages/specfile/spec_parser.py", line 235, in get_rpm_spec
    raise RPMException(stderr=stderr) from e
specfile.exceptions.RPMException: line 1648: Too many names: %files -n dogtag-pki -f\\ .mfiles

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!)

Metadata

Metadata

Assignees

Labels

kind/bugAn unexpected problem or behavior

Type

No type

Projects

Status

done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0