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

Side by Side Diff: build/mac/tweak_app_infoplist

Issue 118036: Tweak SVNVersion be happier (matches windows).... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/file_version_info_mac.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 58
59 TOP="${SRCROOT}/.." 59 TOP="${SRCROOT}/.."
60 BUILD_BRANDING=$1 60 BUILD_BRANDING=$1
61 BRAND_SCRIPT="${TOP}/build/branding_value.sh" 61 BRAND_SCRIPT="${TOP}/build/branding_value.sh"
62 62
63 set -x 63 set -x
64 64
65 APP_NAME=$("${BRAND_SCRIPT}" "${BUILD_BRANDING}" PRODUCT_FULLNAME) 65 APP_NAME=$("${BRAND_SCRIPT}" "${BUILD_BRANDING}" PRODUCT_FULLNAME)
66 SRC_APP_PATH="${BUILT_PRODUCTS_DIR}/${APP_NAME}.app" 66 SRC_APP_PATH="${BUILT_PRODUCTS_DIR}/${APP_NAME}.app"
67 67
68 # Figure out what version this build corresponds to. Just use the svn revision 68 # Visible in the about:version page.
69 # for now. Warning: my svnversion returns 10495:10552M. But that's ok since 69 SVN_REVISION=$(svn info "${SRCROOT}" | grep "Revision:" | cut -d" " -f2-)
70 # it is just for reference.
71 SVN_REVISION=$(svnversion "${SRCROOT}")
72 if [ -z "${SVN_REVISION}" ] ; then 70 if [ -z "${SVN_REVISION}" ] ; then
jeremy 2009/06/01 18:15:06 Could you add a comment about needing to add a cod
73 echo "warning: could not determine svn revision" >&2 71 echo "Could not determine svn revision. This may be OK." >&2
74 fi 72 fi
75 73
76 # Pull in the chrome version number 74 # Pull in the chrome version number
77 . "${TOP}/chrome/VERSION" 75 . "${TOP}/chrome/VERSION"
78 FULL_VERSION="${MAJOR}.${MINOR}.${BUILD}.${PATCH}" 76 FULL_VERSION="${MAJOR}.${MINOR}.${BUILD}.${PATCH}"
79 SHORT_VERSION="${MAJOR}.${MINOR}.${BUILD}" 77 SHORT_VERSION="${MAJOR}.${MINOR}.${BUILD}"
80 78
81 # Fetch the copyright 79 # Fetch the copyright
82 COPYRIGHT_STRING=$("${BRAND_SCRIPT}" "${BUILD_BRANDING}" COPYRIGHT) 80 COPYRIGHT_STRING=$("${BRAND_SCRIPT}" "${BUILD_BRANDING}" COPYRIGHT)
83 # Map (c) or (C) to the copyright sign 81 # Map (c) or (C) to the copyright sign
84 COPYRIGHT_STRING=$(echo "${COPYRIGHT_STRING}" | sed -e $'s/([cC])/\302\251/g') 82 COPYRIGHT_STRING=$(echo "${COPYRIGHT_STRING}" | sed -e $'s/([cC])/\302\251/g')
85 83
86 # Build the full copyright string 84 # Build the full copyright string
87 LONG_COPYRIGHT="${APP_NAME} ${FULL_VERSION}, ${COPYRIGHT_STRING}" 85 LONG_COPYRIGHT="${APP_NAME} ${FULL_VERSION}, ${COPYRIGHT_STRING}"
88 86
89 # I really hate how "defaults" doesn't take a real pathname but instead insists 87 # I really hate how "defaults" doesn't take a real pathname but instead insists
90 # on appending ".plist" to everything. 88 # on appending ".plist" to everything.
91 INFO_PLIST_PATH="Contents/Info.plist" 89 INFO_PLIST_PATH="Contents/Info.plist"
92 TMP_INFO_PLIST_DEFAULTS="${TEMP_DIR}/Info" 90 TMP_INFO_PLIST_DEFAULTS="${TEMP_DIR}/Info"
93 TMP_INFO_PLIST="${TMP_INFO_PLIST_DEFAULTS}.plist" 91 TMP_INFO_PLIST="${TMP_INFO_PLIST_DEFAULTS}.plist"
94 cp "${SRC_APP_PATH}/${INFO_PLIST_PATH}" "${TMP_INFO_PLIST}" 92 cp "${SRC_APP_PATH}/${INFO_PLIST_PATH}" "${TMP_INFO_PLIST}"
95 93
96 # Save off the svn version number in case we need it 94 # Save off the svn version number in case we need it
97 defaults write "${TMP_INFO_PLIST_DEFAULTS}" \ 95 if [ ! -z "${SVN_REVISION}" ] ; then
96 defaults write "${TMP_INFO_PLIST_DEFAULTS}" \
98 SVNRevision -string "${SVN_REVISION}" 97 SVNRevision -string "${SVN_REVISION}"
98 fi
99 99
100 # Add public version info so "Get Info" works 100 # Add public version info so "Get Info" works
101 defaults write "${TMP_INFO_PLIST_DEFAULTS}" \ 101 defaults write "${TMP_INFO_PLIST_DEFAULTS}" \
102 CFBundleGetInfoString -string "${LONG_COPYRIGHT}" 102 CFBundleGetInfoString -string "${LONG_COPYRIGHT}"
103 defaults write "${TMP_INFO_PLIST_DEFAULTS}" \ 103 defaults write "${TMP_INFO_PLIST_DEFAULTS}" \
104 CFBundleShortVersionString -string "${SHORT_VERSION}" 104 CFBundleShortVersionString -string "${SHORT_VERSION}"
105 # Honor the 429496.72.95 limit. The maximum comes from splitting 2^32 - 1 into 105 # Honor the 429496.72.95 limit. The maximum comes from splitting 2^32 - 1 into
106 # 6, 2, 2 digits. The limitation was present in Tiger, but it could have been 106 # 6, 2, 2 digits. The limitation was present in Tiger, but it could have been
107 # fixed in later OS release, but hasn't been tested (it's easy enough to find 107 # fixed in later OS release, but hasn't been tested (it's easy enough to find
108 # out with "lsregister -dump). 108 # out with "lsregister -dump).
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 defaults delete "${TMP_INFO_PLIST_DEFAULTS}" KSVersion || true 152 defaults delete "${TMP_INFO_PLIST_DEFAULTS}" KSVersion || true
153 defaults delete "${TMP_INFO_PLIST_DEFAULTS}" KSProductID || true 153 defaults delete "${TMP_INFO_PLIST_DEFAULTS}" KSProductID || true
154 defaults delete "${TMP_INFO_PLIST_DEFAULTS}" KSUpdateURL || true 154 defaults delete "${TMP_INFO_PLIST_DEFAULTS}" KSUpdateURL || true
155 fi 155 fi
156 156
157 # Info.plist will work perfectly well in any plist format, but traditionally 157 # Info.plist will work perfectly well in any plist format, but traditionally
158 # applications use xml1 for this, so convert it back after whatever defaults 158 # applications use xml1 for this, so convert it back after whatever defaults
159 # might have done. 159 # might have done.
160 plutil -convert xml1 "${TMP_INFO_PLIST}" 160 plutil -convert xml1 "${TMP_INFO_PLIST}"
161 cp "${TMP_INFO_PLIST}" "${SRC_APP_PATH}/${INFO_PLIST_PATH}" 161 cp "${TMP_INFO_PLIST}" "${SRC_APP_PATH}/${INFO_PLIST_PATH}"
OLDNEW
« no previous file with comments | « base/file_version_info_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698