[rtems-source-builder commit] sb/config.py: Fix operator reconstruction

Vijay Kumar Banerjee vijay at rtems.org
Thu Mar 11 16:50:17 UTC 2021


Module:    rtems-source-builder
Branch:    master
Commit:    5e449fb5c2cb6812a238f9f9764fd339cbbf05c2
Changeset: http://git.rtems.org/rtems-source-builder/commit/?id=5e449fb5c2cb6812a238f9f9764fd339cbbf05c2

Author:    Ricardo Cárdenes <rcardenes at gemini.edu>
Date:      Wed Mar 10 21:32:08 2021 -1000

sb/config.py: Fix operator reconstruction

Close #4335

---

 source-builder/sb/config.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/source-builder/sb/config.py b/source-builder/sb/config.py
index d3ba6cd..5bc96e2 100644
--- a/source-builder/sb/config.py
+++ b/source-builder/sb/config.py
@@ -991,9 +991,9 @@ class file:
             else:
                 if len(ifls) >= 3:
                     for op in ['==', '!=', '>=', '=>', '=<', '<=', '>', '<']:
-                        ops = s.split(op)
-                        if len(ops) == 2:
-                            ifls = (ops[0], op, ops[1])
+                        if op in ifls:
+                            op_pos = ifls.index(op)
+                            ifls = (' '.join(ifls[:op_pos]), op, ' '.join(ifls[op_pos + 1:]))
                             break
                 if len(ifls) != 3:
                      self._error('malformed if: ' + reduce(add, ls, ''))



More information about the vc mailing list