diff options
author | Daniel Drake <dsd@laptop.org> | 2012-03-03 00:03:51 (GMT) |
---|---|---|
committer | Daniel Drake <dsd@laptop.org> | 2012-03-21 19:24:14 (GMT) |
commit | 01738e0fa2d3011f050707e6783b6b0d687cc71c (patch) | |
tree | bd82f64fc637e947f6f5ed00e9294e5f7967d1d8 /osbuilder.py | |
parent | fd526e48df52b1694acdf16e3193c3efaa745f5b (diff) |
Specify modules through ini file sections
Instead of listing all the modules in [global].modules,
load all modules specified in the .ini file using [module] notation.
This makes the config file format more friendly to making a build
from various config files specified together, and avoids the annoying
cases when you add a new [configuration section] but forget to add
the module to the module list (not realising your mistake until after
the build has completed).
Diffstat (limited to 'osbuilder.py')
-rwxr-xr-x | osbuilder.py | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/osbuilder.py b/osbuilder.py index 32d5c48..0cddd94 100755 --- a/osbuilder.py +++ b/osbuilder.py @@ -300,18 +300,9 @@ class OsBuilder(object): print "Press Ctrl+C to abort. Continuing in 15 seconds." time.sleep(15) - 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.modules = self.cfg.sections() + if 'global' in self.modules: + self.modules.remove('global') self.read_config() |