#541 `rpkg srpm` fails if there is a `sources` directory
Closed: Fixed 3 years ago by onosek. Opened 3 years ago by reznik.

I build SRPM from a project. There is a sources directory in it. But rpkg fails:

[root@e8e1463b8f78 ada-pretty]# rpkg --verbose srpm
Traceback (most recent call last):
  File "/usr/bin/rpkg", line 80, in <module>
    client.args.command()
  File "/usr/lib/python3.9/site-packages/rpkglib/cli.py", line 219, in srpm
    self.cmd.sources()
  File "/usr/lib/python3.9/site-packages/rpkglib/__init__.py", line 246, in sources
    sourcesf = SourcesFile(
  File "/usr/lib/python3.9/site-packages/pyrpkg/sources.py", line 39, in __init__
    with open(sourcesfile) as f:
IsADirectoryError: [Errno 21] Is a directory: '/tmp/src/ada-pretty/sources'

Hi,
projects in dist-git repositories require to have a file containing hashes. It is usually (by default, but there are some exceptions for different layouts) called sources.
This file is created automatically when your sources (tarball) are uploaded to dist-git with new-sources command.
So there should not be a directory with the same name - it causes a collision. But the exception you got is a valid bug for me. It is better to show a message to the user. There is a PR opened for it.
https://pagure.io/rpkg/pull-request/546

Metadata Update from @onosek:
- Issue set to the milestone: 1.63

2 years ago

Login to comment on this ticket.

Metadata
Related Pull Requests
  • #546 Merged 3 years ago