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

Side by Side Diff: get_latest_image.sh

Issue 3612004: Add board option to au test harness so that this works for others without a default board. (Closed) Base URL: http://git.chromium.org/git/crosutils.git
Patch Set: Clean up board Created 10 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « bin/loman.py ('k') | lib/cros_build_lib.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/bin/bash 1 #!/bin/bash
2 2
3 # Copyright (c) 2009 The Chromium OS Authors. All rights reserved. 3 # Copyright (c) 2009 The Chromium OS 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 # Prints the path to the most recently built image to stdout. 7 # Prints the path to the most recently built image to stdout.
8 8
9 # Load common constants. This should be the first executable line. 9 # Load common constants. This should be the first executable line.
10 # The path to common.sh should be relative to your script's location. 10 # The path to common.sh should be relative to your script's location.
11 . "$(dirname "$0")/common.sh" 11 . "$(dirname "$0")/common.sh"
12 12
13 get_default_board 13 get_default_board
14 14
15 DEFINE_string board "$DEFAULT_BOARD" \ 15 DEFINE_string board "$DEFAULT_BOARD" \
16 "The name of the board to check for images." 16 "The name of the board to check for images."
17 17
18 # Parse command line flags 18 # Parse command line flags
19 FLAGS "$@" || exit 1 19 FLAGS "$@" || exit 1
20 eval set -- "${FLAGS_ARGV}" 20 eval set -- "${FLAGS_ARGV}"
21 21
22 # Check on the board that they are trying to set up. 22 # Check on the board that they are trying to set up.
23 if [ -z "$FLAGS_board" ] ; then 23 if [ -z "$FLAGS_board" ] ; then
24 echo "Error: --board required." 24 die "Error: --board required."
25 exit 1
26 fi 25 fi
27 26
28 IMAGES_DIR="${DEFAULT_BUILD_ROOT}/images/${FLAGS_board}" 27 IMAGES_DIR="${DEFAULT_BUILD_ROOT}/images/${FLAGS_board}"
29 28
30 # If there are no images, return nothing 29 # If there are no images, return nothing
31 [ -d $IMAGES_DIR ] || exit 0 30 [ -d $IMAGES_DIR ] || exit 0
32 31
33 # Use latest link if it exists, otherwise most recently changed dir 32 # Use latest link if it exists, otherwise most recently changed dir
34 if [ -L ${IMAGES_DIR}/latest ] ; then 33 if [ -L ${IMAGES_DIR}/latest ] ; then
35 DEFAULT_FROM="${IMAGES_DIR}/`readlink ${IMAGES_DIR}/latest`" 34 DEFAULT_FROM="${IMAGES_DIR}/`readlink ${IMAGES_DIR}/latest`"
36 else 35 else
37 DEFAULT_FROM="${IMAGES_DIR}/`ls -t $IMAGES_DIR | head -1`" 36 DEFAULT_FROM="${IMAGES_DIR}/`ls -t $IMAGES_DIR | head -1`"
38 fi 37 fi
39 38
40 echo $DEFAULT_FROM 39 echo $DEFAULT_FROM
OLDNEW
« no previous file with comments | « bin/loman.py ('k') | lib/cros_build_lib.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698