Move VERSION file location into top level variable
This will allow for easier overwriting
R=ahe@google.com, whesse@google.com
BUG=
Review URL: https://codereview.chromium.org//1359293002 .
diff --git a/tools/utils.py b/tools/utils.py
index 7379d6a..7b203aa 100644
--- a/tools/utils.py
+++ b/tools/utils.py
@@ -240,6 +240,7 @@
ARCH_GUESS = GuessArchitecture()
BASE_DIR = os.path.abspath(os.path.join(os.curdir, '..'))
DART_DIR = os.path.abspath(os.path.join(__file__, '..', '..'))
+VERSION_FILE = os.path.join(DART_DIR, 'tools', 'VERSION')
def GetBuildbotGSUtilPath():
gsutil = '/b/build/scripts/slave/gsutil'
@@ -341,13 +342,12 @@
return match.group(1)
return None
- version_file = os.path.join(DART_DIR, 'tools', 'VERSION')
try:
- fd = open(version_file)
+ fd = open(VERSION_FILE)
content = fd.read()
fd.close()
except:
- print "Warning: Couldn't read VERSION file (%s)" % version_file
+ print "Warning: Couldn't read VERSION file (%s)" % VERSION_FILE
return None
channel = match_against('^CHANNEL ([A-Za-z0-9]+)$', content)
@@ -361,7 +361,7 @@
return Version(
channel, major, minor, patch, prerelease, prerelease_patch)
else:
- print "Warning: VERSION file (%s) has wrong format" % version_file
+ print "Warning: VERSION file (%s) has wrong format" % VERSION_FILE
return None