Created attachment 923009 [details]
Patch to add the desired features to mock
Description of problem:
The SCM integration within mock makes some specific assumptions about the nature of the SCM repository. Unfortunately, the product repository I am building out of does not follow the assumption that all buildable elements of a repository are at level one.
Version-Release number of selected component (if applicable):
Using SCM integration, attempt to check out and build an item two more levels below the top of the SCM tree.
Steps to Reproduce:
1. enable SCM integration
2. use a source repository more than two levels deep (we use CVS as the VCS)
mock -r <> --scm-enable --scm-option branch=branch --scm-option package=Products/Group-A/product-a
mock starts by complaining it cannot create it's work directory, based on the SCM_PKG name (--scm-option package)
A clean build, using the SCM integration
The attached patch resolves the issue for us, converting the multi-level path in to a single directory element for the temporary directory (in get_sources()); correcting an assumption about how to rename the checked out directory later in the same routine. And finally, it adds a feature to trim the SCM_PKG down to the last element of the path, for use as in the specification file name
This issue still exists in 1.2.7, and the patch continues to apply cleanly.