slapos.rebootstrap is an extensions for zc.buildout is created to solve chicken and egg problem while working with buildout and when some exact version of Python, which is provided by buildout shall be used to execute this buildout itself.
Usage
Create part which compiles python and exposes as executable parameter produced python executable. This part shall NOT return this location to avoid it being removed during part uninstallation.
Add slapos.rebootstrap to extensions and set rebooter-section to above section.
Use whatever python to bootstrap and run buildout. If reboot will detect that sys.executable used to run buildout is different then executable provided in python section it will try to find this executable. If it does not exists it will install this section and then reinstall buildout using new python executable.
Thanks to this whole buildout will be run using python provided by buildout itself. Of course python will be recompiled again, as buildout signature changed, and there is not trust at all in first python invocation.
Example profile and invocation
[buildout]
extensions = slapos.rebootstrap
rebootstrap-section = slapospython
parts =
realrun
[slapospython]
recipe = plone.recipe.command
command = ln -sf /usr/bin/python ${:executable}
update-command = ${:command}
executable = ${buildout:bin-directory}/slapospython
[realrun]
recipe = plone.recipe.command
command =
echo Running with python ${buildout:executable}
update-command = ${:command}
After bootstrapping and running this buildout it will print:
Running with Python /path/to/python/provided/by/mypython/section
Product's homepage
Requirements:
· Python
What's New in This Release: [ read full changelog ]
· Renamed from slapos.tool.rebootstrap 2.4 [Łukasz Nowak]