Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/osbuilder.py
diff options
context:
space:
mode:
authorDaniel Drake <dsd@laptop.org>2010-04-12 13:30:49 (GMT)
committer Daniel Drake <dan@reactivated.net>2010-04-12 13:37:48 (GMT)
commit49988fa042af1e79647be0dfe046b9225cb90e3b (patch)
tree0a1e15df7df4219a557859cd5ca346b1294eeb32 /osbuilder.py
parentad2681335f5ba501f0d2a50dfa585b7c66da38d2 (diff)
Allow modules to be selected by more than 1 configuration option
This means that the additional defaults file can be used to add modules to the list, without having to copy the whole list.
Diffstat (limited to 'osbuilder.py')
-rwxr-xr-xosbuilder.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/osbuilder.py b/osbuilder.py
index fefaac9..f91ae58 100755
--- a/osbuilder.py
+++ b/osbuilder.py
@@ -273,6 +273,10 @@ class OsBuilder(object):
self.cfg = ConfigParser()
self.cfg.read(self.build_config)
+ # read in defaults specified on the command line
+ if self.additional_defaults is not None:
+ self.cfg.read(self.additional_defaults)
+
if self.cfg.has_option('global', 'suggested_oob_version'):
suggested = self.cfg.get('global','suggested_oob_version')
if suggested != VERSION:
@@ -288,10 +292,19 @@ class OsBuilder(object):
print "Press Ctrl+C to abort. Continuing in 15 seconds."
time.sleep(15)
- self.modules = self.cfg.get('global','modules').split(',')
+ self.modules = []
+ for option in self.cfg.options('global'):
+ if not option.startswith('modules_') and option != "modules":
+ continue
+ self.modules.extend(self.cfg.get('global', option).split(','))
+
+ # clean up
for idx, mod in enumerate(self.modules):
self.modules[idx] = mod.strip()
+ # remove duplicates
+ self.modules = list(set(self.modules))
+
self.read_config()
def get_ks_file_path(self):