Index: native_client_sdk/src/build_tools/build_utils.py |
=================================================================== |
--- native_client_sdk/src/build_tools/build_utils.py (revision 112129) |
+++ native_client_sdk/src/build_tools/build_utils.py (working copy) |
@@ -19,29 +19,34 @@ |
from nacl_sdk_scons import nacl_utils |
-def ChromeMilestone(): |
- '''Extract chrome_milestone from src/DEPS |
+# Reuse last change utility code. |
+SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) |
+SRC_DIR = os.path.dirname(os.path.dirname(os.path.dirname(SCRIPT_DIR))) |
+print SRC_DIR |
noelallen_use_chromium
2011/12/01 01:42:40
debugging info?
bradn
2011/12/01 01:52:02
Done.
|
+sys.path.append(os.path.join(SRC_DIR, 'build/util')) |
+import lastchange |
+ |
+def ChromeVersion(): |
+ '''Extract chrome version from src/chrome/VERSION + svn. |
+ |
Returns: |
- Chrome milestone variable value from src/DEPS. |
+ Chrome version string or trunk + svn rev. |
''' |
- parent_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) |
- def From(x, y): |
- return '' |
- def Var(x): |
- return '' |
- def File(x): |
- return '' |
- with open(os.path.join(parent_dir, 'DEPS'), 'r') as fh: |
- exec(fh.read()) |
- return vars.get('chrome_milestone') |
+ info = lastchange.FetchVersionInfo(None) |
+ if info.url.startswith('/trunk/'): |
+ return 'trunk.%s' % info.revision |
+ else: |
+ with open(os.path.join(SRC_DIR, 'chrome', 'VERSION'), 'r') as fh: |
noelallen_use_chromium
2011/12/01 01:42:40
Does this hide the e exception so that you get a r
bradn
2011/12/01 01:52:02
Done.
|
+ exec(fh.read()) |
+ return '%s.%s.%s.%s' % (MAJOR, MINOR, BUILD, PATCH) |
#------------------------------------------------------------------------------ |
# Parameters |
# Revision numbers for the SDK |
-PLATFORM_VERSION = 'pepper_' + ChromeMilestone() |
+PLATFORM_VERSION = ChromeVersion() |
noelallen_use_chromium
2011/12/01 01:42:40
This might effect the "pepper_XX" string used in t
bradn
2011/12/01 01:52:02
Done.
|
TOOLCHAIN_AUTODETECT = "AUTODETECT" |