Commit 6e754e0c authored by Julien Muchembled's avatar Julien Muchembled

Drop 'dependencies' option

It is redundant with the fact that slapos.buildout already rebuilds
if any dependency is modified. slapos.buildout does not yet understand
the new => syntax from upstream buildout but meanwhile a dummy option
can be set to any options of required parts.
parent 539e1112
...@@ -174,16 +174,6 @@ Supported options ...@@ -174,16 +174,6 @@ Supported options
If any item doesn't exist, the recipe shows a warning message. The If any item doesn't exist, the recipe shows a warning message. The
default value is empty. default value is empty.
``dependencies``
List all the depended parts:
dependencies = part1 part2 ...
All the dependent parts will be installed before this part, besides
the changes in any dependent parts will trigger to reinstall
current part.
``environment-section`` ``environment-section``
Name of a section that provides environment variables that will be used to Name of a section that provides environment variables that will be used to
...@@ -912,76 +902,6 @@ replaced with the recipe final prefix. ...@@ -912,76 +902,6 @@ replaced with the recipe final prefix.
package: Executing pre-install package: Executing pre-install
installing package at /sample_buildout/parts/package -lib installing package at /sample_buildout/parts/package -lib
Extra part dependencies
=======================
The recipe will treat all the parts list in the option
``dependencies`` as dependent parts. zc.buildout will install all the
dependent parts before install this part. For example,
>>> write('buildout.cfg',
... """
... [buildout]
... newest = false
... parts = package
...
... [package]
... recipe = slapos.recipe.cmmi
... dependencies = package-2
... url = file://%s/package-0.0.0.tar.gz
...
... [package-2]
... recipe = slapos.recipe.cmmi
... url = file://%s/package-0.0.0.tar.gz
... """ % (src, src))
Here "package-2" will be installed first, because it's a denpend part
of "package":
>>> print(system(buildout))
Uninstalling package.
Installing package-2.
configure --prefix=/sample_buildout/parts/package-2
building package
installing package
Installing package.
configure --prefix=/sample_buildout/parts/package
building package
installing package
Now let's add a new option for "package-2",
>>> write('buildout.cfg',
... """
... [buildout]
... newest = false
... parts = package
...
... [package]
... recipe = slapos.recipe.cmmi
... dependencies = package-2
... url = file://%s/package-0.0.0.tar.gz
...
... [package-2]
... recipe = slapos.recipe.cmmi
... url = file://%s/package-0.0.0.tar.gz
... configure-command = ./configure
... """ % (src, src))
Look, "package" is reinstalled either:
>>> print(system(buildout))
Uninstalling package.
Uninstalling package-2.
Installing package-2.
configure
building package
installing package
Installing package.
configure --prefix=/sample_buildout/parts/package
building package
installing package
Install shared package Install shared package
====================== ======================
......
...@@ -84,25 +84,6 @@ class Recipe(object): ...@@ -84,25 +84,6 @@ class Recipe(object):
options['path'] = options.get('path', '').strip() options['path'] = options.get('path', '').strip()
options['promises'] = options.get('promises', '') options['promises'] = options.get('promises', '')
# Check dependencies, all the dependent parts will be installed first. It
# seems once part is referenced, for example, self.buildout[part], it will
# be appended as an install part.
# dpendent_parts = options.get('dependencies', '').split()
# assert isinstance(buildout, zc.buildout.buildout.Buildout)
# buildout._compute_part_signatures(
# [part for part in dpendent_parts if part not in buildout._parts])
# Calculate md5sum of all the options for each dependent part, and save it
# as option "dependencies". So if any dependent part changes, zc.buildout
# will reinstall the part because this option is changed.
dependencies = []
for part in options.get('dependencies', '').split():
m = md5()
for v in self.buildout[part].values():
m.update(v.encode('utf-8'))
dependencies.append(m.hexdigest())
options['dependencies'] = ' '.join(dependencies)
if options['url'] and options['path']: if options['url'] and options['path']:
raise zc.buildout.UserError('You must use either "url" or "path", not both!') raise zc.buildout.UserError('You must use either "url" or "path", not both!')
if not (options['url'] or options['path']): if not (options['url'] or options['path']):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment