Bug 510409 - Mock not building SRPM
Mock not building SRPM
Status: CLOSED CURRENTRELEASE
Product: Fedora Hosted Projects
Classification: Retired
Component: mock (Show other bugs)
unspecified
x86_64 Linux
low Severity medium
: ---
: ---
Assigned To: Clark Williams
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-07-09 02:38 EDT by Joshua Baldock
Modified: 2013-01-10 00:17 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-08-12 15:47:32 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Patch to allow --sources to be either a directory or a single file (2.05 KB, patch)
2009-08-05 14:56 EDT, Ricky Zhou
no flags Details | Diff

  None (edit)
Description Joshua Baldock 2009-07-09 02:38:11 EDT
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.
Comment 1 Ricky Zhou 2009-08-05 14:56:26 EDT
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 15:27:08 EDT
merged for upcoming mock-1.1.2 release
Comment 3 Fedora Update System 2010-08-07 19:23:03 EDT
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.