Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at
Bug 510409 - Mock not building SRPM
Summary: Mock not building SRPM
Alias: None
Product: Fedora Hosted Projects
Classification: Retired
Component: mock
Version: unspecified
Hardware: x86_64
OS: Linux
Target Milestone: ---
Assignee: Clark Williams
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2009-07-09 06:38 UTC by Joshua Baldock
Modified: 2013-01-10 05:17 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2010-08-12 19:47:32 UTC

Attachments (Terms of Use)
Patch to allow --sources to be either a directory or a single file (deleted)
2009-08-05 18:56 UTC, Ricky Zhou
no flags Details | Diff

Description Joshua Baldock 2009-07-09 06:38:11 UTC
Description of problem: When trying to use mock to build srpm from source and spec file, build fails

Version-Release number of selected component (if applicable): 0.9.14 el5

How reproducible: Everytime i try to build srpm with mock.

Steps to Reproduce:
1. configure mock system
2. run following command 'mock -r rhel-5-x86_64 --no-clean --buildsrpm --spec=distcc.spec --sources=distcc-3.1.tar.gz'
Actual results:
Traceback (most recent call last):
  File "/usr/sbin/mock", line 678, in ?
  File "/usr/sbin/mock", line 623, in main
    do_buildsrpm(config_opts, chroot, options, args)
  File "/usr/sbin/mock", line 400, in do_buildsrpm
    chroot.buildsrpm(spec=options.spec, sources=options.sources, timeout=config_opts['rpmbuild_timeout'])
  File "<peak.util.decorators.rewrap wrapping mock.backend.buildsrpm at 0x2B81F5411578>", line 3, in buildsrpm
  File "/usr/lib/python2.4/site-packages/mock/", line 70, in trace
    result = func(*args, **kw)
  File "/usr/lib/python2.4/site-packages/mock/", line 468, in buildsrpm
    shutil.copytree(sources, self.makeChrootPath(self.builddir, "SOURCES"))
  File "/usr/lib64/python2.4/", line 110, in copytree
    names = os.listdir(src)
OSError: [Errno 20] Not a directory: 'distcc-3.1.tar.gz'

Expected results:
both distcc.spec and distcc-3.1.tar.gz copied into chroot build env SPECS and SOURCES directories respectively. SRPM to be produced from build.

Additional info: I may be doing something incorrect, but i can't seem to find sufficient information on the correct process.

Comment 1 Ricky Zhou 2009-08-05 18:56:26 UTC
Created attachment 356410 [details]
Patch to allow --sources to be either a directory or a single file

It looks like mock takes a directory for the argument to --sources, by design, though this isn't made very clear in the --help output.  

Here's an untested patch to make it take either a directory or a single file, if that would be useful functionality.

Comment 2 Clark Williams 2010-07-27 19:27:08 UTC
merged for upcoming mock-1.1.2 release

Comment 3 Fedora Update System 2010-08-07 23:23:03 UTC
mock-1.1.3-1.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.