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

Unified Diff: webkit/tools/test_shell/mac/keystone_install.sh

Issue 18521: Keystone auto-update support for TestShell (Closed) Base URL: svn://chrome-svn.corp.google.com/chrome/trunk/src/
Patch Set: '' Created 11 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/tools/test_shell/mac/TestShell.xcodeproj/project.pbxproj ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/tools/test_shell/mac/keystone_install.sh
===================================================================
--- webkit/tools/test_shell/mac/keystone_install.sh (revision 0)
+++ webkit/tools/test_shell/mac/keystone_install.sh (revision 0)
@@ -0,0 +1,51 @@
+#!/bin/sh
+
+# Copyright (c) 2009 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# Called by the Keystone system to update the installed application with a new
+# version from a disk image.
+
+set -e
+
+# The argument should be the disk image path. Make sure it exists.
+if [ ! -d "${1}" ] ; then
+ exit 1
+fi
+
+# Who we are.
+APP_NAME="Chromium TestShell.app"
+SRC="${1}/${APP_NAME}"
+
+# Sanity, make sure that there's something to copy from.
+if [ ! -d "${SRC}" ] ; then
+ exit 1
+fi
+
+# Figure out where we're going.
+BUNDLE_ID=$(defaults read "${SRC}/Contents/Info" CFBundleIdentifier)
+DEST=$(ksadmin -pP "${BUNDLE_ID}" | grep xc= | sed -E 's/.+path=(.+)>$/\1/g')
+
+# More sanity checking.
+if [ -z "${SRC}" ] || [ -z "${DEST}" ] || [ ! -d $(dirname "${DEST}") ]; then
+ exit 1
+fi
+
+# This usage will preserve any changes the user made to the application name.
+rsync -a --delete "${SRC}/" "${DEST}/"
+
+VERSION=$(defaults read "${DEST}/Contents/Info" SVNRevision)
+URL=$(defaults read "${DEST}/Contents/Info" KSUpdateURL)
+
+# Notify LaunchServices.
+/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister "${DEST}"
+
+# Notify Keystone.
+ksadmin -P "${BUNDLE_ID}" \
+ --version "${VERSION}" \
+ --xcpath "${DEST}" \
+ --url "${URL}"
+
+# Great success!
+exit 0
Property changes on: webkit/tools/test_shell/mac/keystone_install.sh
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:eol-style
+ LF
« no previous file with comments | « webkit/tools/test_shell/mac/TestShell.xcodeproj/project.pbxproj ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698