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

Side by Side Diff: get_latest_image.sh

Issue 2857020: Added --preserve option and logic. (Closed) Base URL: ssh://git@chromiumos-git/crosutils.git
Patch Set: Resolve conflicts Created 10 years, 6 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 | « build_image ('k') | 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 #!/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 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
30 # If there are no images, return nothing
31 [ -d $IMAGES_DIR ] || exit 0
32
29 # Default to the most recent image 33 # Default to the most recent image
30 DEFAULT_FROM="${IMAGES_DIR}/`ls -t $IMAGES_DIR | head -1`" 34 DEFAULT_FROM="${IMAGES_DIR}/`ls -t $IMAGES_DIR | head -1`"
31 35
32 echo $DEFAULT_FROM 36 echo $DEFAULT_FROM
OLDNEW
« no previous file with comments | « build_image ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698