Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Unified Diff: native_client_sdk/src/build_tools/build_utils.py

Issue 8758013: Using chrome's VERSION file for branches, or the svn rev for trunk (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « native_client_sdk/src/DEPS ('k') | native_client_sdk/src/build_tools/buildbot_run.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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"
« no previous file with comments | « native_client_sdk/src/DEPS ('k') | native_client_sdk/src/build_tools/buildbot_run.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698