OLD | NEW |
---|---|
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. |
(...skipping 12 matching lines...) Expand all Loading... | |
23 if [ -z "$FLAGS_board" ] ; then | 23 if [ -z "$FLAGS_board" ] ; then |
24 echo "Error: --board required." | 24 echo "Error: --board required." |
25 exit 1 | 25 exit 1 |
26 fi | 26 fi |
27 | 27 |
28 IMAGES_DIR="${DEFAULT_BUILD_ROOT}/images/${FLAGS_board}" | 28 IMAGES_DIR="${DEFAULT_BUILD_ROOT}/images/${FLAGS_board}" |
29 | 29 |
30 # If there are no images, return nothing | 30 # If there are no images, return nothing |
31 [ -d $IMAGES_DIR ] || exit 0 | 31 [ -d $IMAGES_DIR ] || exit 0 |
32 | 32 |
33 # Default to the most recent image | 33 # Use latest link if it exists, otherwise most recently changed dir |
34 DEFAULT_FROM="${IMAGES_DIR}/`ls -t $IMAGES_DIR | head -1`" | 34 if [ -L ${IMAGES_DIR}/latest ] ; then |
35 » DEFAULT_FROM="${IMAGES_DIR}/`readlink ${IMAGES_DIR}/latest`" | |
davidjames
2010/08/05 03:59:26
Please remove tabs
| |
36 else | |
37 » DEFAULT_FROM="${IMAGES_DIR}/`ls -t $IMAGES_DIR | head -1`" | |
38 fi | |
35 | 39 |
36 echo $DEFAULT_FROM | 40 echo $DEFAULT_FROM |
OLD | NEW |