OLD | NEW |
1 #!/bin/sh | 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 # Make sure we got the header to write into passed to us | 7 # Make sure we got the header to write into passed to us |
8 if [ $# -ne 1 ]; then | 8 if [ $# -ne 1 ]; then |
9 echo "error: missing branding as an argument" >&2 | 9 echo "error: missing branding as an argument" >&2 |
10 exit 1 | 10 exit 1 |
11 fi | 11 fi |
(...skipping 26 matching lines...) Expand all Loading... |
38 SVN_REVISION=$(svnversion "${SRCROOT}") | 38 SVN_REVISION=$(svnversion "${SRCROOT}") |
39 if [ -z "${SVN_REVISION}" ] ; then | 39 if [ -z "${SVN_REVISION}" ] ; then |
40 echo "warning: could not determine svn revision" >&2 | 40 echo "warning: could not determine svn revision" >&2 |
41 fi | 41 fi |
42 | 42 |
43 # Pull in the chrome version number | 43 # Pull in the chrome version number |
44 . "${TOP}/chrome/VERSION" | 44 . "${TOP}/chrome/VERSION" |
45 FULL_VERSION="${MAJOR}.${MINOR}.${BUILD}.${PATCH}" | 45 FULL_VERSION="${MAJOR}.${MINOR}.${BUILD}.${PATCH}" |
46 SHORT_VERSION="${MAJOR}.${MINOR}.${BUILD}" | 46 SHORT_VERSION="${MAJOR}.${MINOR}.${BUILD}" |
47 | 47 |
48 # Collect the year | 48 # Load the branding file |
49 YEAR=$(date +%Y) | |
50 | |
51 # Copyright is based on branding | |
52 if [ "${BUILD_BRANDING}" == "Chromium" ]; then | 49 if [ "${BUILD_BRANDING}" == "Chromium" ]; then |
53 LONG_COPYRIGHT="${BUILD_BRANDING} ${FULL_VERSION}, Copyright ${YEAR} The Chrom
ium Authors." | 50 BRANDING_FILE="${TOP}/chrome/app/theme/chromium/BRANDING" |
54 elif [ "${BUILD_BRANDING}" == "Chrome" ]; then | 51 elif [ "${BUILD_BRANDING}" == "Chrome" ]; then |
55 LONG_COPYRIGHT="${BUILD_BRANDING} ${FULL_VERSION}, Copyright ${YEAR} Google In
c." | 52 BRANDING_FILE="${TOP}/chrome/app/theme/google_chrome/BRANDING" |
56 else | 53 else |
57 echo "error: unknown branding: ${BUILD_BRANDING}" >&2 | 54 echo "error: unknown branding: ${BUILD_BRANDING}" >&2 |
58 exit 1 | 55 exit 1 |
59 fi | 56 fi |
| 57 COPYRIGHT_STRING=$(sed -n -e 's/^COPYRIGHT=\(.*\)$/\1/p' "${BRANDING_FILE}") |
| 58 # Map (c) or (C) to the copyright sign |
| 59 COPYRIGHT_STRING=$(echo "${COPYRIGHT_STRING}" | sed -e $'s/([cC])/\302\251/g') |
| 60 |
| 61 |
| 62 # Build the full copyright string |
| 63 LONG_COPYRIGHT="${BUILD_BRANDING} ${FULL_VERSION}, ${COPYRIGHT_STRING}" |
60 | 64 |
61 # I really hate how "defaults" doesn't take a real pathname but instead insists | 65 # I really hate how "defaults" doesn't take a real pathname but instead insists |
62 # on appending ".plist" to everything. | 66 # on appending ".plist" to everything. |
63 INFO_PLIST_PATH="Contents/Info.plist" | 67 INFO_PLIST_PATH="Contents/Info.plist" |
64 TMP_INFO_PLIST_DEFAULTS="${TEMP_DIR}/Info" | 68 TMP_INFO_PLIST_DEFAULTS="${TEMP_DIR}/Info" |
65 TMP_INFO_PLIST="${TMP_INFO_PLIST_DEFAULTS}.plist" | 69 TMP_INFO_PLIST="${TMP_INFO_PLIST_DEFAULTS}.plist" |
66 cp "${SRC_APP_PATH}/${INFO_PLIST_PATH}" "${TMP_INFO_PLIST}" | 70 cp "${SRC_APP_PATH}/${INFO_PLIST_PATH}" "${TMP_INFO_PLIST}" |
67 | 71 |
68 # Save off the svn version number in case we need it | 72 # Save off the svn version number in case we need it |
69 defaults write "${TMP_INFO_PLIST_DEFAULTS}" \ | 73 defaults write "${TMP_INFO_PLIST_DEFAULTS}" \ |
(...skipping 14 matching lines...) Expand all Loading... |
84 defaults write "${TMP_INFO_PLIST_DEFAULTS}" \ | 88 defaults write "${TMP_INFO_PLIST_DEFAULTS}" \ |
85 CFBundleVersion -string "${BUILD}.${PATCH}" | 89 CFBundleVersion -string "${BUILD}.${PATCH}" |
86 defaults write "${TMP_INFO_PLIST_DEFAULTS}" \ | 90 defaults write "${TMP_INFO_PLIST_DEFAULTS}" \ |
87 NSHumanReadableCopyright -string "${LONG_COPYRIGHT}" | 91 NSHumanReadableCopyright -string "${LONG_COPYRIGHT}" |
88 | 92 |
89 # Info.plist will work perfectly well in any plist format, but traditionally | 93 # Info.plist will work perfectly well in any plist format, but traditionally |
90 # applications use xml1 for this, so convert it back after whatever defaults | 94 # applications use xml1 for this, so convert it back after whatever defaults |
91 # might have done. | 95 # might have done. |
92 plutil -convert xml1 "${TMP_INFO_PLIST}" | 96 plutil -convert xml1 "${TMP_INFO_PLIST}" |
93 cp "${TMP_INFO_PLIST}" "${SRC_APP_PATH}/${INFO_PLIST_PATH}" | 97 cp "${TMP_INFO_PLIST}" "${SRC_APP_PATH}/${INFO_PLIST_PATH}" |
OLD | NEW |