diff options
author | lambroslambrou@chromium.org <lambroslambrou@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-22 04:18:36 +0000 |
---|---|---|
committer | lambroslambrou@chromium.org <lambroslambrou@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-22 04:18:36 +0000 |
commit | c48b880e8498f647d49f400378444905d7c1a653 (patch) | |
tree | 81107061cfcf0ba86e1e154addee64903e996bdf /remoting/webapp | |
parent | 2c7ad4a7e0a48aac80b90e3135a8ff8ef2b74ab3 (diff) | |
download | chromium_src-c48b880e8498f647d49f400378444905d7c1a653.zip chromium_src-c48b880e8498f647d49f400378444905d7c1a653.tar.gz chromium_src-c48b880e8498f647d49f400378444905d7c1a653.tar.bz2 |
Use system time instead of SVN revision for Remoting version.
The revision-getting code is broken on Mac, so this is a
workaround.
BUG=None
TEST=Manual
Review URL: http://codereview.chromium.org/7485009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@93546 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/webapp')
-rw-r--r-- | remoting/webapp/build-webapp.py | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/remoting/webapp/build-webapp.py b/remoting/webapp/build-webapp.py index fe4df67..124f60a 100644 --- a/remoting/webapp/build-webapp.py +++ b/remoting/webapp/build-webapp.py @@ -19,17 +19,9 @@ import platform import re import shutil import sys +import time import zipfile -# Find the location of the lastchange module relative to this script, and -# modify the system path so it can be imported. -# This section was copied from webkit/build/webkit_version.py. -path = os.path.dirname(os.path.realpath(__file__)) -path = os.path.dirname(os.path.dirname(path)) -path = os.path.join(path, 'build', 'util') -sys.path.insert(0, path) -import lastchange - def findAndReplace(filepath, findString, replaceString): """Does a search and replace on the contents of a file.""" oldFilename = os.path.basename(filepath) + '.old' @@ -124,15 +116,15 @@ def buildWebApp(mimetype, destination, zip_path, plugin, name_suffix, files): name_suffix) # Add unique build numbers to manifest version. - revision = lastchange.FetchVersionInfo(False).revision - # Revision number might look like "12345-dirty" ('-dirty' can be added by - # build/util/lastchange.py:FetchGitSVNRevision() ), so extract the - # numeric portion of the revision string. - revisionNumber = int(re.findall(r'\d+', revision)[0]) + # For now, this is based on the system clock (seconds since 1/1/1970), since + # a previous attempt (based on build/utils/lastchange.py) was failing on Mac. + # TODO(lambroslambrou): Use the SVN revision number or an incrementing build + # number (http://crbug.com/90110). + timestamp = int(time.time()) # Version string must be 1-4 numbers separated by dots, with each number # between 0 and 0xffff. - version1 = revisionNumber / 0x10000 - version2 = revisionNumber % 0x10000 + version1 = timestamp / 0x10000 + version2 = timestamp % 0x10000 findAndReplace(os.path.join(destination, 'manifest.json'), 'UNIQUE_VERSION', '%d.%d' % (version1, version2)) |