Add bootstrap_script property to BootstrapInfo

This allows plugins to manipulate the debootstrap process
This commit is contained in:
Anders Ingemann 2015-12-11 00:48:14 +01:00
parent 55b2d2228f
commit 42d12d440d
2 changed files with 8 additions and 0 deletions

View file

@ -55,6 +55,10 @@ class BootstrapInformation(object):
# that hint at how a command may be made available.
self.host_dependencies = {}
# Path to optional bootstrapping script for modifying the behaviour of debootstrap
# (will be used instead of e.g. /usr/share/debootstrap/scripts/jessie)
self.bootstrap_script = None
# Lists of startup scripts that should be installed and disabled
self.initd = {'install': {}, 'disable': []}

View file

@ -75,6 +75,10 @@ class Bootstrap(Task):
log.debug('Found matching tarball, skipping download')
options.extend(['--unpack-tarball=' + tarball])
if info.bootstrap_script is not None:
# Optional bootstrapping script to modify the bootstrapping process
arguments.append(info.bootstrap_script)
from ..tools import log_check_call
log_check_call(executable + options + arguments)