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

Side by Side Diff: common.sh

Issue 3010045: Check for system shflags (Closed) Base URL: http://src.chromium.org/git/crosutils
Patch Set: Created 10 years, 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 # Common constants for build scripts 5 # Common constants for build scripts
6 # This must evaluate properly for both /bin/bash and /bin/sh 6 # This must evaluate properly for both /bin/bash and /bin/sh
7 7
8 # All scripts should die on error unless commands are specifically excepted 8 # All scripts should die on error unless commands are specifically excepted
9 # by prefixing with '!' or surrounded by 'set +e' / 'set -e'. 9 # by prefixing with '!' or surrounded by 'set +e' / 'set -e'.
10 # TODO: Re-enable this once shflags is less prone to dying. 10 # TODO: Re-enable this once shflags is less prone to dying.
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 set -e 68 set -e
69 69
70 # Read settings 70 # Read settings
71 . $CHROMEOS_DEV_SETTINGS 71 . $CHROMEOS_DEV_SETTINGS
72 72
73 # Restore previous state of exit-on-error 73 # Restore previous state of exit-on-error
74 eval "$SAVE_OPTS" 74 eval "$SAVE_OPTS"
75 fi 75 fi
76 76
77 # Load shflags 77 # Load shflags
78 . "${SRC_ROOT}/scripts/lib/shflags/shflags" 78 if [[ -f /usr/lib/shflags ]]; then
79 . /usr/lib/shflags
80 else
81 . "${SRC_ROOT}/scripts/lib/shflags/shflags"
82 fi
79 83
80 # Our local mirror 84 # Our local mirror
81 DEFAULT_CHROMEOS_SERVER=${CHROMEOS_SERVER:-"http://build.chromium.org/mirror"} 85 DEFAULT_CHROMEOS_SERVER=${CHROMEOS_SERVER:-"http://build.chromium.org/mirror"}
82 86
83 # Upstream mirrors and build suites come in 2 flavors 87 # Upstream mirrors and build suites come in 2 flavors
84 # DEV - development chroot, used to build the chromeos image 88 # DEV - development chroot, used to build the chromeos image
85 # IMG - bootable image, to run on actual hardware 89 # IMG - bootable image, to run on actual hardware
86 90
87 DEFAULT_DEV_MIRROR=${CHROMEOS_DEV_MIRROR:-"${DEFAULT_CHROMEOS_SERVER}/ubuntu"} 91 DEFAULT_DEV_MIRROR=${CHROMEOS_DEV_MIRROR:-"${DEFAULT_CHROMEOS_SERVER}/ubuntu"}
88 DEFAULT_DEV_SUITE=${CHROMEOS_DEV_SUITE:-"karmic"} 92 DEFAULT_DEV_SUITE=${CHROMEOS_DEV_SUITE:-"karmic"}
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 start_time=$(date +%s) 449 start_time=$(date +%s)
446 450
447 # Print time elsapsed since start_time. 451 # Print time elsapsed since start_time.
448 print_time_elapsed() { 452 print_time_elapsed() {
449 end_time=$(date +%s) 453 end_time=$(date +%s)
450 elapsed_seconds="$(( $end_time - $start_time ))" 454 elapsed_seconds="$(( $end_time - $start_time ))"
451 minutes="$(( $elapsed_seconds / 60 ))" 455 minutes="$(( $elapsed_seconds / 60 ))"
452 seconds="$(( $elapsed_seconds % 60 ))" 456 seconds="$(( $elapsed_seconds % 60 ))"
453 echo "Elapsed time: ${minutes}:${seconds}" 457 echo "Elapsed time: ${minutes}:${seconds}"
454 } 458 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698