OLD | NEW |
1 #!/bin/bash | 1 #!/bin/bash |
2 | 2 |
3 # Copyright (c) 2009 The Chromium Authors. All rights reserved. | 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 | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 set -e | 7 set -e |
8 | 8 |
9 # Pull off the optional args | 9 # Pull off the optional args |
10 USE_BREAKPAD=0 | 10 USE_BREAKPAD=0 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 BUILD_BRANDING=$1 | 64 BUILD_BRANDING=$1 |
65 BRAND_SCRIPT="${TOP}/build/branding_value.sh" | 65 BRAND_SCRIPT="${TOP}/build/branding_value.sh" |
66 | 66 |
67 set -x | 67 set -x |
68 | 68 |
69 APP_NAME=$("${BRAND_SCRIPT}" "${BUILD_BRANDING}" PRODUCT_FULLNAME) | 69 APP_NAME=$("${BRAND_SCRIPT}" "${BUILD_BRANDING}" PRODUCT_FULLNAME) |
70 SRC_APP_PATH="${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}" | 70 SRC_APP_PATH="${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}" |
71 | 71 |
72 if [ "${USE_SVN}" = "1" ] ; then | 72 if [ "${USE_SVN}" = "1" ] ; then |
73 # Visible in the about:version page. | 73 # Visible in the about:version page. |
74 SVN_INFO=$(svn info "${TOP}") | 74 SVN_INFO=$(svn info "${TOP}" 2>/dev/null || true) |
75 SVN_REVISION=$(echo "${SVN_INFO}" | sed -Ene 's/^Revision: (.*)$/\1/p') | 75 SVN_REVISION=$(echo "${SVN_INFO}" | sed -Ene 's/^Revision: (.*)$/\1/p') |
76 if [ -z "${SVN_REVISION}" ] ; then | 76 if [ -z "${SVN_REVISION}" ] ; then |
77 echo "Could not determine svn revision. This may be OK." >&2 | 77 GIT_INFO=$(git log -1 --grep=git-svn-id --format=%b 2>/dev/null || true) |
78 # TODO: check for git, and get the version number from it? | 78 SVN_REVISION=$(echo "${GIT_INFO}" \ |
79 fi | 79 | sed -Ene 's/^git-svn-id: .*@([0-9]+).*$/\1/p') |
80 | 80 # Finding the revision for git and svn has failed. |
81 # Grab the path to the source root in the Subversion repository by taking the | 81 if [ -z "${SVN_REVISION}" ] ; then |
82 # URL to the source root directory and the repository root, and removing the | 82 echo "Could not determine svn revision. This may be OK." >&2 |
83 # latter from the former. This ensures that SVN_PATH will contain a useful | 83 else |
84 # path regardless of the Subversion server, mirror, and authentication scheme | 84 SVN_PATH=$(echo "${GIT_INFO}" \ |
85 # in use. | 85 | sed -Ene 's%^git-svn-id: .*/chrome/(.*)@.*$%/\1%p') |
86 SVN_URL=$(echo "${SVN_INFO}" | sed -Ene 's/^URL: (.*)$/\1/p') | 86 fi |
87 SVN_ROOT=$(echo "${SVN_INFO}" | sed -Ene 's/^Repository Root: (.*)$/\1/p') | 87 else |
88 if [ -n "${SVN_ROOT}" ] && \ | 88 # Grab the path to the source root in the Subversion repository by taking |
89 [ "${SVN_URL:0:${#SVN_ROOT}}" = "${SVN_ROOT}" ] ; then | 89 # the URL to the source root directory and the repository root, and |
90 SVN_PATH="${SVN_URL:${#SVN_ROOT}}" | 90 # removing the latter from the former. This ensures that SVN_PATH will |
| 91 # contain a useful path regardless of the Subversion server, mirror, and |
| 92 # authentication scheme in use. |
| 93 SVN_URL=$(echo "${SVN_INFO}" | sed -Ene 's/^URL: (.*)$/\1/p') |
| 94 SVN_ROOT=$(echo "${SVN_INFO}" | sed -Ene 's/^Repository Root: (.*)$/\1/p') |
| 95 if [ -n "${SVN_ROOT}" ] && \ |
| 96 [ "${SVN_URL:0:${#SVN_ROOT}}" = "${SVN_ROOT}" ] ; then |
| 97 SVN_PATH="${SVN_URL:${#SVN_ROOT}}" |
| 98 fi |
91 fi | 99 fi |
92 fi | 100 fi |
93 | 101 |
94 # Pull in the Chrome version number. | 102 # Pull in the Chrome version number. |
95 . "${TOP}/chrome/VERSION" | 103 . "${TOP}/chrome/VERSION" |
96 FULL_VERSION="${MAJOR}.${MINOR}.${BUILD}.${PATCH}" | 104 FULL_VERSION="${MAJOR}.${MINOR}.${BUILD}.${PATCH}" |
97 | 105 |
98 # Fetch the copyright. | 106 # Fetch the copyright. |
99 COPYRIGHT_STRING=$("${BRAND_SCRIPT}" "${BUILD_BRANDING}" COPYRIGHT) | 107 COPYRIGHT_STRING=$("${BRAND_SCRIPT}" "${BUILD_BRANDING}" COPYRIGHT) |
100 # Map (c) or (C) to the copyright symbol. | 108 # Map (c) or (C) to the copyright symbol. |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 fi | 190 fi |
183 | 191 |
184 # Info.plist will work perfectly well in any plist format, but traditionally | 192 # Info.plist will work perfectly well in any plist format, but traditionally |
185 # applications use xml1 for this, so convert it back after whatever defaults | 193 # applications use xml1 for this, so convert it back after whatever defaults |
186 # might have done. | 194 # might have done. |
187 plutil -convert xml1 "${TMP_INFO_PLIST}" | 195 plutil -convert xml1 "${TMP_INFO_PLIST}" |
188 cp "${TMP_INFO_PLIST}" "${SRC_APP_PATH}/${INFO_PLIST_PATH}" | 196 cp "${TMP_INFO_PLIST}" "${SRC_APP_PATH}/${INFO_PLIST_PATH}" |
189 | 197 |
190 # Clean up. | 198 # Clean up. |
191 rm -f "${TMP_INFO_PLIST}" | 199 rm -f "${TMP_INFO_PLIST}" |
OLD | NEW |