On Mon, 2005-06-20 at 13:26 -0400, Dan Williams wrote:
1) Ability to pass $statedir from mock's command line. Since
process calling mock has no clue where the buildroot actually is
(without parsing the *.cfg file for the buildroot, see issues with that
below), the builder needs to be able to specify where mock writes its
state so that the builder can read that state. We talked about adding a
"--statedir" parameter to mock.
The attached patch negates this issue, since the process calling mock
can determine the buildroot directory from the first line of mock's
2) Doing multiple concurrent builds with two separate mock processes
the same target/buildroot will fail because the mock *.cfg file for a
buildroot doesn't distinguish between different processes. We've talked
Perhaps another solution would be to add a mock argument like
"--rootdir-suffix" such that the calling process could specify a suffix
to add, and in the buildsystem that would most likely be the jobid of
the build job.
The attached patch fixes this by adding a "--buildroot-suffix" switch
that allows the caller to pass an string (allowed characters are
_-[a-z][A-Z][0-9]) which is appended to the buildroots directory.
Default is nothing, and the new functionality is only triggered by usage
of this switch.
3) The build client is expected to clean up after the mock process,
it cannot know what directory to delete unless it's able to find out
what the buildroot dir is from mock. Ideally the client wouldn't have
to parse the mock .cfg file, but perhaps mock would write out the
buildroot dir to its stdout first thing, or some other mechanism of
telling the calling process what the buildroot dir is.
This is fixed in the attached patch because the client can find the
buildroot dir from the first line of mock output.
The patch also fixes a traceback where 'my' is undefined if the call to
Root() fails for any reason (usually, in the cleaning stage).
my.close() was unconditionally called no matter whether or not 'my' had
already been defined.
Seth: if the patch looks OK and the solutions are acceptable, I can
commit when you give the ack.