| OLD | NEW |
| 1 #!/bin/bash -p | 1 #!/bin/bash -p |
| 2 | 2 |
| 3 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2011 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 # usage: keystone_install.sh update_dmg_mount_point | 7 # usage: keystone_install.sh update_dmg_mount_point |
| 8 # | 8 # |
| 9 # Called by the Keystone system to update the installed application with a new | 9 # Called by the Keystone system to update the installed application with a new |
| 10 # version from a disk image. | 10 # version from a disk image. |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 export -n SHELLOPTS | 56 export -n SHELLOPTS |
| 57 | 57 |
| 58 set -o pipefail | 58 set -o pipefail |
| 59 shopt -s nullglob | 59 shopt -s nullglob |
| 60 | 60 |
| 61 ME="$(basename "${0}")" | 61 ME="$(basename "${0}")" |
| 62 readonly ME | 62 readonly ME |
| 63 | 63 |
| 64 # Workaround for http://code.google.com/p/chromium/issues/detail?id=83180#c3 | 64 # Workaround for http://code.google.com/p/chromium/issues/detail?id=83180#c3 |
| 65 # In bash 4.0, "declare VAR" no longer initializes VAR if not already set. | 65 # In bash 4.0, "declare VAR" no longer initializes VAR if not already set. |
| 66 GOOGLE_CHROME_UPDATER_DEBUG="${GOOGLE_CHROME_UPDATER_DEBUG:-}" | 66 : ${GOOGLE_CHROME_UPDATER_DEBUG:=} |
| 67 err() { | 67 err() { |
| 68 local error="${1}" | 68 local error="${1}" |
| 69 | 69 |
| 70 local id= | 70 local id= |
| 71 if [[ -n "${GOOGLE_CHROME_UPDATER_DEBUG}" ]]; then | 71 if [[ -n "${GOOGLE_CHROME_UPDATER_DEBUG}" ]]; then |
| 72 id=": ${$} $(date "+%Y-%m-%d %H:%M:%S %z")" | 72 id=": ${$} $(date "+%Y-%m-%d %H:%M:%S %z")" |
| 73 fi | 73 fi |
| 74 | 74 |
| 75 echo "${ME}${id}: ${error}" >& 2 | 75 echo "${ME}${id}: ${error}" >& 2 |
| 76 } | 76 } |
| (...skipping 1185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1262 | 1262 |
| 1263 # Check "less than" instead of "not equal to" in case Keystone ever changes to | 1263 # Check "less than" instead of "not equal to" in case Keystone ever changes to |
| 1264 # pass more arguments. | 1264 # pass more arguments. |
| 1265 if [[ ${#} -lt 1 ]]; then | 1265 if [[ ${#} -lt 1 ]]; then |
| 1266 usage | 1266 usage |
| 1267 exit 2 | 1267 exit 2 |
| 1268 fi | 1268 fi |
| 1269 | 1269 |
| 1270 main "${@}" | 1270 main "${@}" |
| 1271 exit ${?} | 1271 exit ${?} |
| OLD | NEW |