summaryrefslogtreecommitdiffstats
path: root/native_client_sdk/src
diff options
context:
space:
mode:
authorbradnelson@google.com <bradnelson@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-02 07:57:06 +0000
committerbradnelson@google.com <bradnelson@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-02 07:57:06 +0000
commitaff96212f4a77fe2b8bc0c1fae32e17821d6216f (patch)
treeb6ed388ef4d51e47a4d33275c15a1ddefbb55097 /native_client_sdk/src
parent0c91f41ca40936bc9bfe6d829cb4ed6f81e7565f (diff)
downloadchromium_src-aff96212f4a77fe2b8bc0c1fae32e17821d6216f.zip
chromium_src-aff96212f4a77fe2b8bc0c1fae32e17821d6216f.tar.gz
chromium_src-aff96212f4a77fe2b8bc0c1fae32e17821d6216f.tar.bz2
Using chrome's VERSION file for branches, or the svn rev for trunk
to decide where to archive to. BUG=None TEST=None R=noelallen@google.com Review URL: http://codereview.chromium.org/8758013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@112652 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'native_client_sdk/src')
-rw-r--r--native_client_sdk/src/DEPS3
-rw-r--r--native_client_sdk/src/build_tools/build_utils.py45
-rwxr-xr-xnative_client_sdk/src/build_tools/buildbot_run.py10
3 files changed, 36 insertions, 22 deletions
diff --git a/native_client_sdk/src/DEPS b/native_client_sdk/src/DEPS
deleted file mode 100644
index f495abd..0000000
--- a/native_client_sdk/src/DEPS
+++ /dev/null
@@ -1,3 +0,0 @@
-vars = {
- "chrome_milestone": "17",
-}
diff --git a/native_client_sdk/src/build_tools/build_utils.py b/native_client_sdk/src/build_tools/build_utils.py
index 60bdc80..a04dc6b 100644
--- a/native_client_sdk/src/build_tools/build_utils.py
+++ b/native_client_sdk/src/build_tools/build_utils.py
@@ -19,29 +19,46 @@ import sys
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)))
+sys.path.append(os.path.join(SRC_DIR, 'build/util'))
+import lastchange
+
+
+# Location of chrome's version file.
+VERSION_PATH = os.path.join(SRC_DIR, 'chrome', 'VERSION')
+
+
+def ChromeVersion():
+ '''Extract chrome version from src/chrome/VERSION + svn.
+
+ Returns:
+ Chrome version string or trunk + svn rev.
+ '''
+ info = lastchange.FetchVersionInfo(None)
+ if info.url.startswith('/trunk/'):
+ return 'trunk.%s' % info.revision
+ else:
+ exec(open(VERSION_PATH, 'r').read())
+ return '%s.%s.%s.%s' % (MAJOR, MINOR, BUILD, PATCH)
+
+
+def ChromeMajorVersion():
+ '''Extract chrome major version from src/chrome/VERSION.
Returns:
- Chrome milestone variable value from src/DEPS.
+ Chrome major version.
'''
- 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')
+ exec(open(VERSION_PATH, 'r').read())
+ return str(MAJOR)
#------------------------------------------------------------------------------
# Parameters
# Revision numbers for the SDK
-PLATFORM_VERSION = 'pepper_' + ChromeMilestone()
+PLATFORM_VERSION = 'pepper_' + ChromeMajorVersion()
TOOLCHAIN_AUTODETECT = "AUTODETECT"
diff --git a/native_client_sdk/src/build_tools/buildbot_run.py b/native_client_sdk/src/build_tools/buildbot_run.py
index a2fa49e..94ceac4 100755
--- a/native_client_sdk/src/build_tools/buildbot_run.py
+++ b/native_client_sdk/src/build_tools/buildbot_run.py
@@ -19,12 +19,12 @@ sys.path.append(os.path.join(SRC_DIR, 'third_party/scons-2.0.1/engine'))
import build_utils
-def Archive(revision, chrome_milestone):
+def Archive(revision, chrome_version):
"""Archive the sdk to google storage.
Args:
revision: SDK svn revision number.
- chrome_milestone: Chrome milestone (m14 etc), this is for.
+ chrome_version: Chrome version number / trunk svn.
"""
if sys.platform in ['cygwin', 'win32']:
src = 'nacl-sdk.exe'
@@ -35,8 +35,8 @@ def Archive(revision, chrome_milestone):
else:
src = 'nacl-sdk.tgz'
dst = 'naclsdk_linux.tgz'
- bucket_path = 'nativeclient-mirror/nacl/nacl_sdk/pepper_%s_%s/%s' % (
- chrome_milestone, revision, dst)
+ bucket_path = 'nativeclient-mirror/nacl/nacl_sdk/%s/%s' % (
+ chrome_version, dst)
full_dst = 'gs://%s' % bucket_path
subprocess.check_call(
'/b/build/scripts/slave/gsutil cp -a public-read %s %s' % (
@@ -80,7 +80,7 @@ def main(argv):
print '@@@BUILD_STEP archive build@@@'
sys.stdout.flush()
Archive(revision=os.environ.get('BUILDBOT_GOT_REVISION'),
- chrome_milestone=build_utils.ChromeMilestone())
+ chrome_version=build_utils.ChromeVersion())
return 0