summaryrefslogtreecommitdiffstats
path: root/build/mac
diff options
context:
space:
mode:
authormark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-11 21:27:35 +0000
committermark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-11 21:27:35 +0000
commit9c4946b2bb89623299bbcff5f632841258957e08 (patch)
tree4cdd2edc77350ac44be7ccd95d30c49435dd8e82 /build/mac
parent4b77bf1d8d5023c6a9232ce41f24d5bfbb3aaff6 (diff)
downloadchromium_src-9c4946b2bb89623299bbcff5f632841258957e08.zip
chromium_src-9c4946b2bb89623299bbcff5f632841258957e08.tar.gz
chromium_src-9c4946b2bb89623299bbcff5f632841258957e08.tar.bz2
Fix build/mac/tweak_app_infoplist build script for git users. Patch by Robert
Sesek <rsesek@gmail.com>. Review URL: http://codereview.chromium.org/165314 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23075 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build/mac')
-rwxr-xr-xbuild/mac/tweak_app_infoplist38
1 files changed, 23 insertions, 15 deletions
diff --git a/build/mac/tweak_app_infoplist b/build/mac/tweak_app_infoplist
index 120c3c8..f1885904 100755
--- a/build/mac/tweak_app_infoplist
+++ b/build/mac/tweak_app_infoplist
@@ -71,23 +71,31 @@ SRC_APP_PATH="${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}"
if [ "${USE_SVN}" = "1" ] ; then
# Visible in the about:version page.
- SVN_INFO=$(svn info "${TOP}")
+ SVN_INFO=$(svn info "${TOP}" 2>/dev/null || true)
SVN_REVISION=$(echo "${SVN_INFO}" | sed -Ene 's/^Revision: (.*)$/\1/p')
if [ -z "${SVN_REVISION}" ] ; then
- echo "Could not determine svn revision. This may be OK." >&2
- # TODO: check for git, and get the version number from it?
- fi
-
- # Grab the path to the source root in the Subversion repository by taking the
- # URL to the source root directory and the repository root, and removing the
- # latter from the former. This ensures that SVN_PATH will contain a useful
- # path regardless of the Subversion server, mirror, and authentication scheme
- # in use.
- SVN_URL=$(echo "${SVN_INFO}" | sed -Ene 's/^URL: (.*)$/\1/p')
- SVN_ROOT=$(echo "${SVN_INFO}" | sed -Ene 's/^Repository Root: (.*)$/\1/p')
- if [ -n "${SVN_ROOT}" ] && \
- [ "${SVN_URL:0:${#SVN_ROOT}}" = "${SVN_ROOT}" ] ; then
- SVN_PATH="${SVN_URL:${#SVN_ROOT}}"
+ GIT_INFO=$(git log -1 --grep=git-svn-id --format=%b 2>/dev/null || true)
+ SVN_REVISION=$(echo "${GIT_INFO}" \
+ | sed -Ene 's/^git-svn-id: .*@([0-9]+).*$/\1/p')
+ # Finding the revision for git and svn has failed.
+ if [ -z "${SVN_REVISION}" ] ; then
+ echo "Could not determine svn revision. This may be OK." >&2
+ else
+ SVN_PATH=$(echo "${GIT_INFO}" \
+ | sed -Ene 's%^git-svn-id: .*/chrome/(.*)@.*$%/\1%p')
+ fi
+ else
+ # Grab the path to the source root in the Subversion repository by taking
+ # the URL to the source root directory and the repository root, and
+ # removing the latter from the former. This ensures that SVN_PATH will
+ # contain a useful path regardless of the Subversion server, mirror, and
+ # authentication scheme in use.
+ SVN_URL=$(echo "${SVN_INFO}" | sed -Ene 's/^URL: (.*)$/\1/p')
+ SVN_ROOT=$(echo "${SVN_INFO}" | sed -Ene 's/^Repository Root: (.*)$/\1/p')
+ if [ -n "${SVN_ROOT}" ] && \
+ [ "${SVN_URL:0:${#SVN_ROOT}}" = "${SVN_ROOT}" ] ; then
+ SVN_PATH="${SVN_URL:${#SVN_ROOT}}"
+ fi
fi
fi