| OLD | NEW |
| (Empty) | |
| 1 #!/bin/sh |
| 2 # |
| 3 # Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. |
| 6 |
| 7 # TODO(mmoss) This is (mostly) just a conversion to sh syntax of |
| 8 # tools/build/win/version.bat. Rewrite both as common python. |
| 9 |
| 10 TMPL="$1" |
| 11 OUTFILE="$2" |
| 12 CHROMEDIR="$3" |
| 13 |
| 14 # Load version digits as environment variables. |
| 15 source "$CHROMEDIR/VERSION" |
| 16 |
| 17 # Load branding strings as environment variables |
| 18 DISTRIBUTION="chromium" |
| 19 if [ "$CHROMIUM_BUILD" = "_google_chrome" ]; then |
| 20 DISTRIBUTION="google_chrome" |
| 21 fi |
| 22 # Make sure the string values are quoted. |
| 23 eval $(sed -e 's/\([^=]*\)=\(.*\)/\1="\2"/' \ |
| 24 "$CHROMEDIR/app/theme/$DISTRIBUTION/BRANDING") |
| 25 |
| 26 # Determine the current repository revision number. |
| 27 LASTCHANGE=$(svn info 2>/dev/null | grep "Revision:" | cut -d" " -f2-) |
| 28 if [ -z "$LASTCHANGE" ]; then |
| 29 # Maybe it's a git client |
| 30 LASTCHANGE=$(git-svn info 2>/dev/null | grep "Revision:" | cut -d" " -f2-) |
| 31 fi |
| 32 |
| 33 OFFICIAL_BUILD="false" |
| 34 if [ "$CHROME_BUILD_TYPE" = "_official" ]; then |
| 35 OFFICIAL_BUILD="true" |
| 36 fi |
| 37 |
| 38 # TODO(mmoss) Make sure no sed special chars in substitutions. |
| 39 sed -e "s/@MAJOR@/$MAJOR/" \ |
| 40 -e "s/@MINOR@/$MINOR/" \ |
| 41 -e "s/@BUILD@/$BUILD/" \ |
| 42 -e "s/@PATCH@/$PATCH/" \ |
| 43 -e "s/@COMPANY_FULLNAME@/$COMPANY_FULLNAME/" \ |
| 44 -e "s/@COMPANY_SHORTNAME@/$COMPANY_SHORTNAME/" \ |
| 45 -e "s/@PRODUCT_FULLNAME@/$PRODUCT_FULLNAME/" \ |
| 46 -e "s/@PRODUCT_SHORTNAME@/$PRODUCT_SHORTNAME/" \ |
| 47 -e "s/@PRODUCT_EXE@/$PRODUCT_EXE/" \ |
| 48 -e "s/@COPYRIGHT@/$COPYRIGHT/" \ |
| 49 -e "s/@OFFICIAL_BUILD@/$OFFICIAL_BUILD/" \ |
| 50 -e "s/@LASTCHANGE@/$LASTCHANGE/" "$TMPL" > "$OUTFILE" |
| OLD | NEW |