summaryrefslogtreecommitdiffstats
path: root/chrome/tools
diff options
context:
space:
mode:
authorrsesek@chromium.org <rsesek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-18 18:05:04 +0000
committerrsesek@chromium.org <rsesek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-18 18:05:04 +0000
commitb13e5b9869bfc68276f492ea64bb6aa5c9660ec3 (patch)
tree2ce8b08328d78a033c4e9bc869d2a1694abd7d1b /chrome/tools
parent77f1d3966c277c456775fca47c1d4455151dd679 (diff)
downloadchromium_src-b13e5b9869bfc68276f492ea64bb6aa5c9660ec3.zip
chromium_src-b13e5b9869bfc68276f492ea64bb6aa5c9660ec3.tar.gz
chromium_src-b13e5b9869bfc68276f492ea64bb6aa5c9660ec3.tar.bz2
[Mac] Fix official build break where the builders do not have git installed.
This fixes the bug two ways to be extra defensive. BUG=none TEST=tweak_info_plist succeeds on internal waterfall Review URL: http://codereview.chromium.org/7037030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85782 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/tools')
-rwxr-xr-xchrome/tools/build/mac/tweak_info_plist14
1 files changed, 12 insertions, 2 deletions
diff --git a/chrome/tools/build/mac/tweak_info_plist b/chrome/tools/build/mac/tweak_info_plist
index eeec906..37a8bdd 100755
--- a/chrome/tools/build/mac/tweak_info_plist
+++ b/chrome/tools/build/mac/tweak_info_plist
@@ -41,8 +41,14 @@ def _GetOutput(args):
def _GetOutputNoError(args):
- """Behaves identically to _GetOutput() but ignores stderr."""
- proc = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ """Similar to _GetOutput() but ignores stderr. If there's an error launching
+ the child (like file not found), the exception will be caught and (None, 1)
+ will be returned to mimic quiet failure."""
+ try:
+ proc = subprocess.Popen(args, stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
+ except OSError:
+ return (None, 1)
(stdout, stderr) = proc.communicate()
return (stdout, proc.returncode)
@@ -122,6 +128,10 @@ def _GetSCMInfo():
# authentication scheme in use.
scm_path = svn_url[len(svn_repo_root):]
+ # If the desired information was found via SVN, return it now.
+ if scm_revision != None and scm_path != None:
+ return (scm_path, scm_revision)
+
# If a SVN revision number couldn't be found, try getting it through git.
(stdout, retval) = _GetOutputNoError(['git', 'log', '-1',
'--grep=git-svn-id', '--format=%b'])