kad/sbdmock

Please create SB target

Opened this issue · 3 comments

I just started using sbdmock. The Maemo chinook config specifies using a scratchbox target called maemo4-arm which does not exist in my scratchbox. sbdmock exits with error:

Error occured: Failed to select target maemo4-arm, exiting

I suggest that sbdmock always removes the target (ignoring any error) and then recreates it from scratch instead of selecting it and then doing the remove. Note that this will mean adding config file options (and command line overrides) for compiler, devkit and CPU transparency.

I would be happy to supply a patch to do this if that would help.

I have looked at the code and noticed that the support for this is already there but it is only done, currently, if the uniqueext option is given. I think it should be done for any target which is being cleaned.

I suppose it might help to explain further why I think this is important. sbdmock is a great tool for doing a test build (using -u). However, if a test build fails, the developer needs an environment in which they can debug why it is failing, try modifying files, installing additional packages, etc.

The existing -u creates a clean environment from scratch but then deletes it again at the end of the build. That is ideal for things like the autobuilder, and for my automatic builds which I do every night.

For developer testing, however, I think it would be useful to allow the developer to specify a named scratchbox target (or use the one specified in the config file) and have it created from scratch (whether it currently exists or not), with the identical parameters that are used when -u is specified, but not have it deleted afterwards. They can then use scratchbox to play around in that target to debug their problem and build new packages files which they can test again.

I have created a patch which changes the behaviour of sbdmock such that if the target is to be cleaned, it is completely deleted and recreated. I think this is a more complete form of cleaning because it means things like the compiler are setup correctly (from the config file). This also solves the original request I raised in this issue: if the target does not exist it is created as part of the cleaning process.

The main change in this patch is to make the decisions on whether the target is to be deleted and created dependent on the "clean" flag instead of the "uniqueext" flag.

I do not know how patches are intended to be submitted on this site, so I ended up creating a page in the wiki for the patch. See: http://wiki.github.com/kad/sbdmock/patch-sbdmock-full-cleanpatch

Please consider applying this patch or something similar.