Commit aff96212 authored by bradnelson@google.com's avatar bradnelson@google.com

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
parent 0c91f41c
vars = {
"chrome_milestone": "17",
}
......@@ -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"
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment