summaryrefslogtreecommitdiffstats
path: root/chrome/tools
diff options
context:
space:
mode:
authormaruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-23 16:07:01 +0000
committermaruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-23 16:07:01 +0000
commit60ea13a2267bc1a34112b074e3cf0566e591ffb1 (patch)
tree9674e28fd9e9894f5be85a6029256f291706adbd /chrome/tools
parent5e06484fabcaa95cc31bab90fa33f8652dab975b (diff)
downloadchromium_src-60ea13a2267bc1a34112b074e3cf0566e591ffb1.zip
chromium_src-60ea13a2267bc1a34112b074e3cf0566e591ffb1.tar.gz
chromium_src-60ea13a2267bc1a34112b074e3cf0566e591ffb1.tar.bz2
Fix version.bat to use the 'default' svn in the PATH and not a precooked one in chromium sources.
BUG=10872 Review URL: http://codereview.chromium.org/92074 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14312 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/tools')
-rw-r--r--chrome/tools/build/win/version.bat36
1 files changed, 30 insertions, 6 deletions
diff --git a/chrome/tools/build/win/version.bat b/chrome/tools/build/win/version.bat
index 93bb162..c224e8a 100644
--- a/chrome/tools/build/win/version.bat
+++ b/chrome/tools/build/win/version.bat
@@ -1,5 +1,9 @@
-:: Batch file run as build command for vers.vcproj
@echo off
+:: Copyright (c) 2009 The Chromium Authors. All rights reserved.
+:: Use of this source code is governed by a BSD-style license that can be
+:: found in the LICENSE file.
+
+:: Batch file run as build command for chrome_dll.vcproj
setlocal
@@ -23,13 +27,33 @@ cat %SolutionDir%app\theme\%Distribution%\BRANDING | sed "s/\(.*\)/set \1/" >> %
set OFFICIAL_BUILD=0
if "%CHROME_BUILD_TYPE%" == "_official" set OFFICIAL_BUILD=1
-:: Determine the current repository revision number
-set PATH=%~dp0..\..\..\..\third_party\svn;%PATH%
-svn.exe info | grep.exe "Revision:" | cut -d" " -f2- | sed "s/\(.*\)/set LASTCHANGE=\1/" >> %VarsBat%
-call %VarsBat%
+:: Look if subversion client is available. It may not be available on Windows
+:: if downloaded with a tarball or depot_tools is not in the PATH.
+call svn --version 2>nul 1>nul
+:: If not available, just skip getting the revision number.
+if errorlevel 1 goto :NO_SVN
+goto :SET_ENV
+
+
+:NO_SVN
+:: Not having svn makes it impossible to determine the current checkout revision
+:: number. On normal build, this is not an issue but for official builds, this
+:: *can't* be tolerated so issue an error instead. VS will pick it up corectly.
+set NO_SVN_LEVEL=error
+if "%OFFICIAL_BUILD%" == "0" set NO_SVN_LEVEL=warning
+echo %0(28) : %NO_SVN_LEVEL% : svn is not installed. Can't determine the revision number.
+echo set LASTCHANGE=0 >> %VarsBat%
+goto :GEN_FILE
-::echo LastChange: %LASTCHANGE%
+:SET_ENV
+call svn info | grep.exe "Revision:" | cut -d" " -f2- | sed "s/\(.*\)/set LASTCHANGE=\1/" >> %VarsBat%
+goto :GEN_FILE
+
+
+:GEN_FILE
+call %VarsBat%
+::echo LastChange: %LASTCHANGE%
:: output file
cat %InFile% | sed "s/@MAJOR@/%MAJOR%/" ^
| sed "s/@MINOR@/%MINOR%/" ^