rootfs: print a proper error if root path not specified anywhere
authorTimo Savola <tsavola@movial.fi>
Tue, 29 Jul 2008 12:22:53 +0000 (15:22 +0300)
committerTimo Savola <tsavola@movial.fi>
Tue, 29 Jul 2008 12:22:56 +0000 (15:22 +0300)
matrix/rootfs.py

index 2acbf13..e6c7d73 100644 (file)
@@ -14,6 +14,8 @@ from config import config
 from config import rootfs
 from config import parse as config_parse
 
+Error = RuntimeError
+
 image_type_list = (
        'jffs2',
        'ubi',
@@ -71,6 +73,8 @@ def main():
        if args:
                rootfs.path = args[0]
                rootfs.target = None
+       elif not rootfs.path and not rootfs.target:
+               raise Error('Root path must be defined in a config file or on the command-line')
 
        build = Builder(rootfs.path, rootfs.target)
        build.include_paths(rootfs.include_paths)