diff options
author | Chris Johns <chrisj@rtems.org> | 2014-08-23 13:26:24 +0000 |
---|---|---|
committer | Chris Johns <chrisj@rtems.org> | 2014-08-23 13:26:24 +0000 |
commit | 2b4cd57ed84f53aebe3f62d284b4ab4a8abeacec (patch) | |
tree | 793556dabe2c0766e2efe6cde1a3a85a97fa4194 | |
parent | rtems-4.11: Use the internal autoconf build. (diff) | |
download | rtems-source-builder-2b4cd57ed84f53aebe3f62d284b4ab4a8abeacec.tar.bz2 |
sb: Fix the if logic for parameters.
-rw-r--r-- | source-builder/sb/config.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/source-builder/sb/config.py b/source-builder/sb/config.py index d5e68d0..d97777b 100644 --- a/source-builder/sb/config.py +++ b/source-builder/sb/config.py @@ -402,6 +402,7 @@ class file: else: cmd = s[2:-1] exit_code, proc, output = e.shell(cmd) + log.trace('shell-output: %d %s' % (exit_code, output)) if exit_code == 0: line = line.replace(s, output) else: @@ -785,7 +786,15 @@ class file: istrue = True else: self._error('invalid if bool operator: ' + reduce(add, ls, '')) - elif len(ifls) == 3: + else: + if len(ifls) > 3: + for op in ['==', '!=', '>=', '=>', '=<', '<=', '>', '<']: + ops = s.split(op) + if len(ops) == 2: + ifls = (ops[0], op, ops[1]) + break + if len(ifls) != 3: + self._error('malformed if: ' + reduce(add, ls, '')) if ifls[1] == '==': if ifls[0] == ifls[2]: istrue = True @@ -818,8 +827,6 @@ class file: istrue = False else: self._error('invalid %if operator: ' + reduce(add, ls, '')) - else: - self._error('malformed if: ' + reduce(add, ls, '')) if invert: istrue = not istrue log.trace('config: %s: _if: %s %s' % (self.name, ifls, str(istrue))) |