[rtems-source-builder commit] sb: Do not accept an extra separate option for --with/--without.

Chris Johns chrisj at rtems.org
Fri Mar 20 02:59:43 UTC 2015


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

Author:    Chris Johns <chrisj at rtems.org>
Date:      Fri Mar 20 13:57:27 2015 +1100

sb: Do not accept an extra separate option for --with/--without.

The --with/--without that does not have an extra option was
consuming an extra option on the command line.

---

 source-builder/sb/options.py | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/source-builder/sb/options.py b/source-builder/sb/options.py
index 663c7f0..e4964f0 100644
--- a/source-builder/sb/options.py
+++ b/source-builder/sb/options.py
@@ -427,7 +427,7 @@ class command_line:
     def params(self):
         return self.opts['params']
 
-    def parse_args(self, arg, error = True):
+    def parse_args(self, arg, error = True, extra = True):
         for a in range(0, len(self.args)):
             if self.args[a].startswith(arg):
                 lhs = None
@@ -439,12 +439,11 @@ class command_line:
                         rhs = '='.join(eqs[1:])
                     else:
                         rhs = eqs[1]
-                else:
+                elif extra:
                     lhs = self.args[a]
                     a += 1
-                    if a >= len(self.args):
-                        return [arg, None]
-                    rhs = self.args[a]
+                    if a < len(self.args):
+                        rhs = self.args[a]
                 return [lhs, rhs]
             a += 1
         return None
@@ -458,7 +457,7 @@ class command_line:
         for pre in ['with', 'without']:
             arg_str = '--%s-%s' % (pre, label)
             arg_label = '%s_%s' % (pre, label)
-            arg = self.parse_args(arg_str, error = False)
+            arg = self.parse_args(arg_str, error = False, extra = False)
             if arg is not None:
                 if arg[1] is  None:
                     result = 'yes'



More information about the vc mailing list