rootfs: support --config-dir
authorTimo Savola <tsavola@movial.fi>
Fri, 18 Jul 2008 08:05:28 +0000 (11:05 +0300)
committerTimo Savola <tsavola@movial.fi>
Fri, 18 Jul 2008 08:05:28 +0000 (11:05 +0300)
matrix/rootfs.py

index 7b6dcb7..519ab8b 100644 (file)
@@ -21,9 +21,19 @@ image_type_list = (
 image_type_default = 'jffs2'
 
 def main():
+       def append_config_dir(option, opt, value, parser):
+               config.initial_config_dirs.append(value)
+
        parser = optparse.OptionParser(usage='%prog [<options>]')
 
        parser.add_option(
+               '-c', '--config-dir', metavar='DIR',
+               help='add a directory for finding config files (may be set ' \
+                    'multiple times)',
+               dest='initial_config_dirs', action='callback',
+               callback=append_config_dir, type='string')
+
+       parser.add_option(
                '-n', '--no-clean',
                help='do not clean env.faked and stripped directory',
                dest='clean', action='store_false', default=True)