summaryrefslogtreecommitdiffstats
path: root/source-builder/sb/setbuilder.py
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2013-03-06 13:30:54 +1100
committerChris Johns <chrisj@rtems.org>2013-03-06 13:30:54 +1100
commit984e4e6f398184da18b80d10f24a8f5ec91750d8 (patch)
tree52f833a7fe970e7dfc2b415765170199bcaa5ee6 /source-builder/sb/setbuilder.py
parentDo not copy on a dry run. (diff)
downloadrtems-source-builder-984e4e6f398184da18b80d10f24a8f5ec91750d8.tar.bz2
Provide better control of sharing the defaults.
When using the set builder and nesting builds prpvide the nested set builder and build objects with copies of the master defaults. Python's variable sharing was sharing a single set of defaults across all build sets and this resulted in popluted configurations.
Diffstat (limited to 'source-builder/sb/setbuilder.py')
-rw-r--r--source-builder/sb/setbuilder.py18
1 files changed, 13 insertions, 5 deletions
diff --git a/source-builder/sb/setbuilder.py b/source-builder/sb/setbuilder.py
index 5681299..253362d 100644
--- a/source-builder/sb/setbuilder.py
+++ b/source-builder/sb/setbuilder.py
@@ -22,6 +22,7 @@
# set lists the various tools. These are specific tool configurations.
#
+import copy
import datetime
import distutils.dir_util
import glob
@@ -64,8 +65,8 @@ class buildset:
def __init__(self, bset, _configs, _defaults, opts):
_trace(opts, '_bset:%s: init' % (bset))
- self.opts = opts
self.configs = _configs
+ self.opts = opts
self.defaults = _defaults
self.bset = bset
self.bset_pkg = '%s-%s-set' % (self.opts.expand('%{_target}', _defaults),
@@ -269,18 +270,25 @@ class buildset:
builds = []
for s in range(0, len(configs)):
try:
+ #
+ # Each section of the build set gets a separate set of
+ # defaults so we do not contaminate one configuration with
+ # another.
+ #
+ _opts = copy.deepcopy(self.opts)
+ _defaults = copy.deepcopy(self.defaults)
if configs[s].endswith('.bset'):
bs = buildset(configs[s],
_configs = self.configs,
- _defaults = self.defaults,
- opts = self.opts)
+ _defaults = _defaults,
+ opts = _opts)
bs.build()
del bs
elif configs[s].endswith('.cfg'):
b = build.build(configs[s],
self.opts.get_arg('--pkg-tar-files'),
- _defaults = self.defaults,
- opts = self.opts)
+ _defaults = _defaults,
+ opts = _opts)
if s == 0:
tmproot = self.first_package(b)
b.make()