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 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
370 | 370 |
371 # Returns 0 (true) if ksadmin supports --brand-path and --brand-key. | 371 # Returns 0 (true) if ksadmin supports --brand-path and --brand-key. |
372 ksadmin_supports_brandpath_brandkey() { | 372 ksadmin_supports_brandpath_brandkey() { |
373 # --brand-path and --brand-key were introduced in Keystone 1.0.8.1620. | 373 # --brand-path and --brand-key were introduced in Keystone 1.0.8.1620. |
374 is_ksadmin_version_ge 1.0.8.1620 | 374 is_ksadmin_version_ge 1.0.8.1620 |
375 | 375 |
376 # The return value of is_ksadmin_version_ge is used as this function's | 376 # The return value of is_ksadmin_version_ge is used as this function's |
377 # return value. | 377 # return value. |
378 } | 378 } |
379 | 379 |
380 # Returns 0 (true) if ksadmin supports --version-path and --version-key. | |
TVL
2011/05/18 17:57:31
for some reason I thought this had been around a l
Mark Mentovai
2011/05/18 18:10:42
TVL wrote:
| |
381 ksadmin_supports_versionpath_versionkey() { | |
382 # --version-path and --version-key were introduced in Keystone 1.0.9.2318. | |
383 is_ksadmin_version_ge 1.0.9.2318 | |
384 | |
385 # The return value of is_ksadmin_version_ge is used as this function's | |
386 # return value. | |
387 } | |
388 | |
380 usage() { | 389 usage() { |
381 echo "usage: ${ME} update_dmg_mount_point" >& 2 | 390 echo "usage: ${ME} update_dmg_mount_point" >& 2 |
382 } | 391 } |
383 | 392 |
384 main() { | 393 main() { |
385 local update_dmg_mount_point="${1}" | 394 local update_dmg_mount_point="${1}" |
386 | 395 |
387 # Early steps are critical. Don't continue past any failure. | 396 # Early steps are critical. Don't continue past any failure. |
388 set -e | 397 set -e |
389 | 398 |
(...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1067 ) | 1076 ) |
1068 fi | 1077 fi |
1069 | 1078 |
1070 if ksadmin_supports_brandpath_brandkey; then | 1079 if ksadmin_supports_brandpath_brandkey; then |
1071 ksadmin_args+=( | 1080 ksadmin_args+=( |
1072 --brand-path "${ksadmin_brand_plist_path}" | 1081 --brand-path "${ksadmin_brand_plist_path}" |
1073 --brand-key "${ksadmin_brand_key}" | 1082 --brand-key "${ksadmin_brand_key}" |
1074 ) | 1083 ) |
1075 fi | 1084 fi |
1076 | 1085 |
1086 if ksadmin_supports_versionpath_versionkey; then | |
1087 ksadmin_args+=( | |
1088 --version-path "${installed_app_plist_path}" | |
TVL
2011/05/18 17:57:31
so my fear here is user installs where they drag i
Mark Mentovai
2011/05/18 18:10:42
TVL wrote:
| |
1089 --version-key "${KS_VERSION_KEY}" | |
1090 ) | |
1091 fi | |
1092 | |
1077 note "ksadmin_args = ${ksadmin_args[*]}" | 1093 note "ksadmin_args = ${ksadmin_args[*]}" |
1078 | 1094 |
1079 if ! ksadmin "${ksadmin_args[@]}"; then | 1095 if ! ksadmin "${ksadmin_args[@]}"; then |
1080 err "ksadmin failed" | 1096 err "ksadmin failed" |
1081 exit 11 | 1097 exit 11 |
1082 fi | 1098 fi |
1083 | 1099 |
1084 # The remaining steps are not considered critical. | 1100 # The remaining steps are not considered critical. |
1085 set +e | 1101 set +e |
1086 | 1102 |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1260 | 1276 |
1261 # Check "less than" instead of "not equal to" in case Keystone ever changes to | 1277 # Check "less than" instead of "not equal to" in case Keystone ever changes to |
1262 # pass more arguments. | 1278 # pass more arguments. |
1263 if [[ ${#} -lt 1 ]]; then | 1279 if [[ ${#} -lt 1 ]]; then |
1264 usage | 1280 usage |
1265 exit 2 | 1281 exit 2 |
1266 fi | 1282 fi |
1267 | 1283 |
1268 main "${@}" | 1284 main "${@}" |
1269 exit ${?} | 1285 exit ${?} |
OLD | NEW |