Skip to content

errors building with dist-git where old "patchN" format is used in spec file #3610

@loise-nolden

Description

@loise-nolden

When building a package that still uses the prior format "%patchN" instead of "%patch N", copr refuses to build the package with the following error message for each affected package.

Reproduce:

  1. create a copr with centos-steam-10 buildroot
  2. use the following build options for a new build:

Source

Package:
-
Version:
-
Source Type:
Build from DistGit
Committish:
c10s
Clone_Url:
https://gitlab.com/redhat/centos-stream/rpms/e2fsprogs.git

and start the build, then the error appears:

cmd: ['dist-git-client', 'srpm', '--outputdir', '/var/lib/copr-rpmbuild/results']
cwd: /var/lib/copr-rpmbuild/workspace/workdir-y800q6c8/e2fsprogs
rc: 1
stdout: 
stderr: INFO: Checked call: rpmbuild -bs /var/lib/copr-rpmbuild/workspace/workdir-y800q6c8/e2fsprogs/./e2fsprogs.spec --define 'dist %nil' --define '_sourcedir /var/lib/copr-rpmbuild/workspace/workdir-y800q6c8/e2fsprogs/.' --define '_srcrpmdir /var/lib/copr-rpmbuild/results' --define '_disable_source_fetch 1'
error: %patchN is obsolete, use %patch N (or %patch -P N): %patch0 -p1

Traceback (most recent call last):
  File "/usr/bin/dist-git-client", line 10, in <module>
    main()
    ~~~~^^
  File "/usr/lib/python3.13/site-packages/dist_git_client.py", line 494, in main
    srpm(args, config)
    ~~~~^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/site-packages/dist_git_client.py", line 348, in srpm
    check_call(command)
    ~~~~~~~~~~^^^^^^^^^
  File "/usr/lib/python3.13/site-packages/dist_git_client.py", line 50, in check_call
    subprocess.check_call(cmd)
    ~~~~~~~~~~~~~~~~~~~~~^^^^^
  File "/usr/lib64/python3.13/subprocess.py", line 419, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['rpmbuild', '-bs', '/var/lib/copr-rpmbuild/workspace/workdir-y800q6c8/e2fsprogs/./e2fsprogs.spec', '--define', 'dist %nil', '--define', '_sourcedir /var/lib/copr-rpmbuild/workspace/workdir-y800q6c8/e2fsprogs/.', '--define', '_srcrpmdir /var/lib/copr-rpmbuild/results', '--define', '_disable_source_fetch 1']' returned non-zero exit status 1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions