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 ? main(retParams) 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/trace_decorator.py", line 70, in trace result = func(*args, **kw) File "/usr/lib/python2.4/site-packages/mock/backend.py", line 468, in buildsrpm shutil.copytree(sources, self.makeChrootPath(self.builddir, "SOURCES")) File "/usr/lib64/python2.4/shutil.py", 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.
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.
merged for upcoming mock-1.1.2 release
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.