Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 #!/bin/sh -p | |
| 2 | |
| 3 # Copyright 2016 The Chromium Authors. All rights reserved. | |
| 4 # Use of this source code is governed by a BSD-style license that can be | |
| 5 # found in the LICENSE file. | |
| 6 | |
| 7 # This script will be called by the installer application to copy Google | |
| 8 # Chrome.app into the proper /Applications folder. This script may run as root. | |
| 9 # | |
| 10 # When running as root, this script will be invoked with the real user ID set | |
| 11 # to the user's ID, but the effective user ID set to 0 (root). bash -p is | |
| 12 # used on the first line to prevent bash from setting the effective user ID to | |
| 13 # the real user ID (dropping root privileges). | |
| 14 | |
| 15 set -euo pipefail | |
|
Anna Zeng
2016/08/23 19:36:12
It'd be helpful to include what the flags mean in
ivanhernandez
2016/08/24 18:23:17
nah.
ivanhernandez
2016/08/24 18:28:26
Whoops forgot to change this joke reply to 'Done.'
| |
| 16 | |
| 17 # Wait's for the main app to pass the path to the app bundle inside the mounted | |
|
Elly Fong-Jones
2016/08/24 16:39:22
Wait's -> Waits
ivanhernandez
2016/08/24 18:23:17
Done.
| |
| 18 # disk image. | |
| 19 read -r SRC | |
| 20 | |
| 21 DEST=${1} | |
|
Elly Fong-Jones
2016/08/24 16:39:22
quotes here
ivanhernandez
2016/08/24 18:23:17
Done.
| |
| 22 APPBUNDLENAME=$(basename "${SRC}") | |
| 23 FULL_DEST="${DEST}"/"${APPBUNDLENAME}" | |
| 24 | |
| 25 # Starts the copy | |
| 26 rsync -lrptq "${SRC}" "${DEST}" | |
|
Anna Zeng
2016/08/23 19:36:12
Ditto!
ivanhernandez
2016/08/24 18:23:17
Done.
| |
| 27 | |
| 28 # If this script is run as root, change ownership to root and set elevated | |
| 29 # permissions. | |
| 30 if [ "${EUID}" -eq 0 ] ; then | |
| 31 chown -Rh root:admin "${FULL_DEST}" | |
| 32 chmod -R a+rX,ug+w,o-w "${FULL_DEST}" | |
| 33 fi | |
| 34 | |
| 35 exit 0 | |
| OLD | NEW |