The configuration syntax in the new version of zc.buildout is extended with two operators += and -= to allow adjusting options in an extended profile. This is very helpful. You don't need anymore to overwrite an option in the base configuration when all you want is to remove/add an entry.
here is an example:
To add new part and remove egg2 in an extended configuration, we do:
Running buildout, the result will be as if you have run it with this configuration file:
That's it.
If you want to add new egg to all your profiles all you have to do is to add it to the base.cfg.
here is an example:
# base.cfg file
[buildout]
parts =
part1
part2
eggs =
eggs1
eggs2
eggs3
To add new part and remove egg2 in an extended configuration, we do:
# newconfig.cfg file
[buildout]
extends = base.cfg
parts +=
part3
eggs -=
eggs2
Running buildout, the result will be as if you have run it with this configuration file:
[buildout]
parts =
part1
part2
part3
eggs =
egg1
eggs3
That's it.
If you want to add new egg to all your profiles all you have to do is to add it to the base.cfg.
11 Jun 2008 03:52:09
How would you add some new entries and remove some others from the same option?
11 Jun 2008 03:55:49
I guess you simply overwrite the option in that case, right?
11 Jun 2008 08:41:15
yes, do it the old way by overwriting the option.
26 Jun 2008 00:31:42
When adding a new egg in an extension-profile with:
eggs +=
eggs2
you can just update the zcml as well:
[instance]
zcml +=
eggs2
22 Aug 2008 17:23:05
Which is this version of zc.buildout.
22 Aug 2008 20:59:44
Hi Encolpe,
The += and -= operators exists since the 1.0.4 version