Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(451)

Unified Diff: chrome/tools/build/win/version.bat

Issue 92074: Fix version.bat to use the 'default' svn in the PATH and not a precooked one ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: copyright Created 11 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/tools/build/win/version.bat
===================================================================
--- chrome/tools/build/win/version.bat (revision 14299)
+++ chrome/tools/build/win/version.bat (working copy)
@@ -1,6 +1,10 @@
-:: 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
set InFile=%~1
@@ -23,13 +27,33 @@
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%
+:: 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
+
+
+: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%/" ^
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698