[Buildd-tools-devel] Bug#477937: Bug#477937: double check for repo type

Roger Leigh rleigh at whinlatter.ukfsn.org
Tue Apr 29 15:22:19 UTC 2008


On Tue, Apr 29, 2008 at 04:58:47PM +0200, martin f krafft wrote:
> also sprach Roger Leigh <rleigh at whinlatter.ukfsn.org> [2008.04.29.1650 +0200]:
> > This should already be possible, unless I misunderstand what you want.
> > The "plain" chroot type is the simplest case, and doesn't do any of the
> > extra stuff the other types do.  You could extend its behaviour in the
> > setup scripts quite easily, and there is the possibility of doing this
> > on a per-chroot basis with the script-config parameter, used to
> > customise the setup scripts.
> 
> I am failing to see how I would have a Git repository type this way,
> without resorting to a hack as I currently do...

This is what I would suggest:

Copy /etc/schroot/script-defaults to /etc/schroot/foo-defaults and add
any additional customisation parameters you want in your setup scripts.
[You can also edit the script-defaults directly, and special case things
based on e.g. CHROOT_TYPE and CHROOT_NAME]  (the full list of variables
is in schroot-setup(5)).

In schroot.conf, set

[foo]
type=plain
script-config=foo-defaults

Create a new setup script e.g. 05git which sources the defaults as all
the other scripts do.  You can then do all your stuff here.  Because all
setup tasks run all scripts, you'll need to do something like

if [ "$USE_GIT" = true ]; then
   ...
fi

(and add USE_GIT=true to your foo-defaults file).


This is still a little hacky.  This is where writing the chroot_git
class would make things a little nicer--it would allow customisation
directly in schroot.conf with extra keys, and set them up in the
environment for the setup scripts to use.  However, I added
script-config to allow users to extend the setup scripts on a per-chroot
basis as they saw fit, without needing to hack the C++ sources.  See
schroot-script-config(5).


Regards,
Roger

-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux             http://people.debian.org/~rleigh/
 `. `'   Printing on GNU/Linux?       http://gutenprint.sourceforge.net/
   `-    GPG Public Key: 0x25BFB848   Please GPG sign your mail.





More information about the Buildd-tools-devel mailing list