Scons: Update compare_versions() to ignore trailing charecters after an int. This... m5_2.0_beta6
authorAli Saidi <saidi@eecs.umich.edu>
Wed, 8 Oct 2008 22:34:19 +0000 (18:34 -0400)
committerAli Saidi <saidi@eecs.umich.edu>
Wed, 8 Oct 2008 22:34:19 +0000 (18:34 -0400)
SConstruct

index f91cb35fef90e35fa6eef55acc7303c1d76870ff..260c025bd4cd5ecf441bcb9adac09f67851492bc 100644 (file)
@@ -91,7 +91,7 @@ def compare_versions(v1, v2):
         if isinstance(v, (list,tuple)):
             return v
         elif isinstance(v, str):
-            return map(int, v.split('.'))
+            return map(lambda x: int(re.match('\d+', x).group()), v.split('.'))
         else:
             raise TypeError