force option
authorTimo Savola <tsavola@movial.fi>
Fri, 4 Apr 2008 13:32:38 +0000 (16:32 +0300)
committerTimo Savola <tsavola@movial.fi>
Fri, 4 Apr 2008 13:35:07 +0000 (16:35 +0300)
builds components with dirty files (ignores cache) instead of failing.
dirty files in the meta directory are no longer considered.

matrix/config.py
matrix/matrix.py

index 15db6f0..40b139b 100644 (file)
@@ -17,6 +17,7 @@ flags = []
 libc = 'glibc'
 verbose = False
 debug = False
+force = False
 
 class Board(object):
        def __init__(self, name, arch, gcc_march, gcc_mcpu='', gcc_mfpu='', gcc_options='', gnu_host='', flash_erase_size='65536', flash_pad_size='0'):
index 8edcc74..c59fed7 100644 (file)
@@ -73,6 +73,7 @@ Options:
                        If this option is not given, the default specified in
                        the components file will be used.  This option may be
                        specified multiple times.
+       -f              Build components with dirty files.
        -h, --help      Print this help text.
 
 Commands and their parameters:
@@ -119,6 +120,8 @@ def parse_args(args):
                                elif args[i] == '-r':
                                        i += 1
                                        config.roots.append(args[i])
+                               elif args[i] == '-f':
+                                       config.force = True
                                elif args[i] in ('-h', '--help'):
                                        help(sys.stdout, args)
                                        sys.exit(0)
@@ -394,11 +397,12 @@ def component_cached(c):
        if c.from_platform:
                return True
 
-       ls_opts = ['-m', '-d']
-       if git.ls_files(c.repo.path, ls_opts):
-               raise Error('Component contains dirty files: ' + c.name)
-       if git.ls_files(c.meta.path, ls_opts):
-               raise Error('Component contains dirty meta files: ' + c.name)
+       for repo in (c.repo, c.meta):
+               if git.ls_files(repo.path, ['-m', '-d']):
+                       if config.force:
+                               return False
+                       else:
+                               raise Error('Dirty files in ' + repo.path)
 
        path = os.path.join(config.cache_dir, c.name)
        if not os.path.exists(path):