summaryrefslogtreecommitdiffstats
path: root/chrome/tools/build
diff options
context:
space:
mode:
authormark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-02 17:44:14 +0000
committermark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-02 17:44:14 +0000
commitdf6da1505fc09b8edb5a22e8455e30b112dd7ea8 (patch)
tree8da4679e597ba7c8c91d182caff9c6c4c142c1bf /chrome/tools/build
parent269e129404527aa945737d25ff51dfc8b46e8d72 (diff)
downloadchromium_src-df6da1505fc09b8edb5a22e8455e30b112dd7ea8.zip
chromium_src-df6da1505fc09b8edb5a22e8455e30b112dd7ea8.tar.gz
chromium_src-df6da1505fc09b8edb5a22e8455e30b112dd7ea8.tar.bz2
Drop the com.apple.quarantine attribute after an update is applied.
BUG=26486 TEST=none Review URL: http://codereview.chromium.org/353007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30708 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/tools/build')
-rwxr-xr-xchrome/tools/build/mac/keystone_install.sh35
1 files changed, 32 insertions, 3 deletions
diff --git a/chrome/tools/build/mac/keystone_install.sh b/chrome/tools/build/mac/keystone_install.sh
index 40d3a50..a7352b6 100755
--- a/chrome/tools/build/mac/keystone_install.sh
+++ b/chrome/tools/build/mac/keystone_install.sh
@@ -305,9 +305,38 @@ fi
chmod -R "${CHMOD_MODE}" "${DEST}" >& /dev/null
# On the Mac, or at least on HFS+, symbolic link permissions are significant,
-# but chmod -R and -h can't be used together on the Mac. Do another pass to
-# fix the permissions on any symbolic links.
-find "${DEST}" -type l -exec chmod -h "${CHMOD_MODE}" {} \; >& /dev/null
+# but chmod -R and -h can't be used together. Do another pass to fix the
+# permissions on any symbolic links.
+find "${DEST}" -type l -exec chmod -h "${CHMOD_MODE}" {} + >& /dev/null
+
+# Host OS version check, to be able to take advantage of features on newer
+# systems and fall back to slow ways of doing things on older systems.
+OS_VERSION=$(sw_vers -productVersion)
+OS_MAJOR=$(sed -Ene 's/^([0-9]+).*/\1/p' <<< ${OS_VERSION})
+OS_MINOR=$(sed -Ene 's/^([0-9]+)\.([0-9]+).*/\2/p' <<< ${OS_VERSION})
+
+# If an update is triggered from within the application itself, the update
+# process inherits the quarantine bit (LSFileQuarantineEnabled). Any files or
+# directories created during the update will be quarantined in that case,
+# which may cause Launch Services to display quarantine UI. That's bad,
+# especially if it happens when the outer .app launches a quarantined inner
+# helper. If the application is already on the system and is being updated,
+# then it can be assumed that it should not be quarantined. Use xattr to drop
+# the quarantine attribute.
+#
+# TODO(mark): Instead of letting the quarantine attribute be set and then
+# dropping it here, figure out a way to get the update process to run without
+# LSFileQuarantineEnabled even when triggering an update from within the
+# application.
+QUARANTINE_ATTR=com.apple.quarantine
+if [ ${OS_MAJOR} -gt 10 ] ||
+ ([ ${OS_MAJOR} -eq 10 ] && [ ${OS_MINOR} -ge 6 ]) ; then
+ # On 10.6, xattr supports -r for recursive operation.
+ xattr -d -r "${QUARANTINE_ATTR}" "${DEST}" >& /dev/null
+else
+ # On earlier systems, xattr doesn't support -r, so run xattr via find.
+ find "${DEST}" -exec xattr -d "${QUARANTINE_ATTR}" {} + >& /dev/null
+fi
# Great success!
exit 0