| OLD | NEW |
| 1 # Copyright 2008 the V8 project authors. All rights reserved. | 1 # Copyright 2008 the V8 project authors. All rights reserved. |
| 2 # Redistribution and use in source and binary forms, with or without | 2 # Redistribution and use in source and binary forms, with or without |
| 3 # modification, are permitted provided that the following conditions are | 3 # modification, are permitted provided that the following conditions are |
| 4 # met: | 4 # met: |
| 5 # | 5 # |
| 6 # * Redistributions of source code must retain the above copyright | 6 # * Redistributions of source code must retain the above copyright |
| 7 # notice, this list of conditions and the following disclaimer. | 7 # notice, this list of conditions and the following disclaimer. |
| 8 # * Redistributions in binary form must reproduce the above | 8 # * Redistributions in binary form must reproduce the above |
| 9 # copyright notice, this list of conditions and the following | 9 # copyright notice, this list of conditions and the following |
| 10 # disclaimer in the documentation and/or other materials provided | 10 # disclaimer in the documentation and/or other materials provided |
| (...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 606 MAJOR_VERSION_PATTERN = re.compile(r"#define\s+MAJOR_VERSION\s+(.*)") | 606 MAJOR_VERSION_PATTERN = re.compile(r"#define\s+MAJOR_VERSION\s+(.*)") |
| 607 MINOR_VERSION_PATTERN = re.compile(r"#define\s+MINOR_VERSION\s+(.*)") | 607 MINOR_VERSION_PATTERN = re.compile(r"#define\s+MINOR_VERSION\s+(.*)") |
| 608 BUILD_NUMBER_PATTERN = re.compile(r"#define\s+BUILD_NUMBER\s+(.*)") | 608 BUILD_NUMBER_PATTERN = re.compile(r"#define\s+BUILD_NUMBER\s+(.*)") |
| 609 PATCH_LEVEL_PATTERN = re.compile(r"#define\s+PATCH_LEVEL\s+(.*)") | 609 PATCH_LEVEL_PATTERN = re.compile(r"#define\s+PATCH_LEVEL\s+(.*)") |
| 610 | 610 |
| 611 patterns = [MAJOR_VERSION_PATTERN, | 611 patterns = [MAJOR_VERSION_PATTERN, |
| 612 MINOR_VERSION_PATTERN, | 612 MINOR_VERSION_PATTERN, |
| 613 BUILD_NUMBER_PATTERN, | 613 BUILD_NUMBER_PATTERN, |
| 614 PATCH_LEVEL_PATTERN] | 614 PATCH_LEVEL_PATTERN] |
| 615 | 615 |
| 616 source = open(join('src', 'version.cc')).read() | 616 source = open(join(root_dir, 'src', 'version.cc')).read() |
| 617 version_components = [] | 617 version_components = [] |
| 618 for pattern in patterns: | 618 for pattern in patterns: |
| 619 match = pattern.search(source) | 619 match = pattern.search(source) |
| 620 if match: | 620 if match: |
| 621 version_components.append(match.group(1).strip()) | 621 version_components.append(match.group(1).strip()) |
| 622 else: | 622 else: |
| 623 version_components.append('0') | 623 version_components.append('0') |
| 624 | 624 |
| 625 return version_components | 625 return version_components |
| 626 | 626 |
| 627 | 627 |
| 628 def GetVersion(): | 628 def GetVersion(): |
| 629 version_components = GetVersionComponents() | 629 version_components = GetVersionComponents() |
| 630 | 630 |
| 631 if version_components[len(version_components) - 1] == '0': | 631 if version_components[len(version_components) - 1] == '0': |
| 632 version_components.pop() | 632 version_components.pop() |
| 633 return '.'.join(version_components) | 633 return '.'.join(version_components) |
| 634 | 634 |
| 635 | 635 |
| 636 def GetSpecificSONAME(): | 636 def GetSpecificSONAME(): |
| 637 SONAME_PATTERN = re.compile(r"#define\s+SONAME\s+\"(.*)\"") | 637 SONAME_PATTERN = re.compile(r"#define\s+SONAME\s+\"(.*)\"") |
| 638 | 638 |
| 639 source = open(join('src', 'version.cc')).read() | 639 source = open(join(root_dir, 'src', 'version.cc')).read() |
| 640 match = SONAME_PATTERN.search(source) | 640 match = SONAME_PATTERN.search(source) |
| 641 | 641 |
| 642 if match: | 642 if match: |
| 643 return match.group(1).strip() | 643 return match.group(1).strip() |
| 644 else: | 644 else: |
| 645 return '' | 645 return '' |
| 646 | 646 |
| 647 | 647 |
| 648 def SplitList(str): | 648 def SplitList(str): |
| 649 return [ s for s in str.split(",") if len(s) > 0 ] | 649 return [ s for s in str.split(",") if len(s) > 0 ] |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 914 # version of scons. Also, there's a bug in some revisions that | 914 # version of scons. Also, there's a bug in some revisions that |
| 915 # doesn't allow this flag to be set, so we swallow any exceptions. | 915 # doesn't allow this flag to be set, so we swallow any exceptions. |
| 916 # Lovely. | 916 # Lovely. |
| 917 try: | 917 try: |
| 918 SetOption('warn', 'no-deprecated') | 918 SetOption('warn', 'no-deprecated') |
| 919 except: | 919 except: |
| 920 pass | 920 pass |
| 921 | 921 |
| 922 | 922 |
| 923 Build() | 923 Build() |
| OLD | NEW |